1

I'm using Programmatic Timer Service (@Timeout) and using Glassfish, and I keep getting the following error:

Internal Exception: java.sql.SQLException: An SQL data change is not permitted for a read-only connection, user or database.

My code is quite simple, and I'm using both Programmatic Timer Service and Automatic Timer Service, and the error only appears for the Programmatic Timer Service:

My code is:

@Timeout
public void programmaticTimeout(Timer timer) {
    sendMessages();
}

// run every minute

@Schedule(hour = "*", minute = "*/1", persistent = false)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void automaticTimeout() {
    sendMessages();
}

The @schedule task works great, while the @Timout throws this exception. The @schedule has a variable that says if to persist the data or not, while the @Timout doesn't.

Any idea what the problem is here? How do I disable the persistence? Thanks.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.