In Glassfish the EJB transaction timeout is set to 120 seconds by default, and I want to change this value.
I know that it can be changed by defining the "cmt-timeout-in-seconds" param in the glassfish-ejb-jar.xml, but I use the Web module with EJB classes in it, and use the glassfish-web.xml respectively.
Is there any way to change the timeout?
UPD:
The Transaction Timeout value in the Transaction Service settings has no effect.
@Schedule(minute = "*/5", hour = "*", persistent = false)
public void doSomething() {
log.info("Started");
try {
Thread.sleep(1000 * 119);
} catch (InterruptedException ex) {
log.info("Interrupted", ex);
}
log.info("Finished");
}
The code above works fine. But if to change the sleep time to 121 seconds
Thread.sleep(1000 * 121);
in the GF Server log I see an error:
Warning: EJB5123:Rolling back timed out transaction
After this, the service invokes the doSomething() method once more, and in 2 minutes I see errors again:
Warning: EJB5123: Rolling back timed out transaction
Info: EJB5119:Expunging timer [...] after [2] failed deliveries
and the service doesn't invoke the doSomething() method anymore.