Transaction Timeout Not working
viswamkalva opened this issue · 1 comments
bitronix.tm.timer.defaultTransactionTimeout=30 I have overridden the default timeout to 30 seconds in my properties file. ActiveMQXAConnectionFactory and Oracle XA Datasource are two resources of my Distributed transaction. after reading a message from queue my transaction begins and while processing the application is taking more than 30 seconds and still transaction is not timed out. Only when committing the transaction its throwing timeout exception. I wanted immediately after 30 seconds the transaction should time out and throw the exception and make that thread available to consume another message from queue. I am not sure if I am missing something. and I have enabled the following ones:
resource.ds1.allowLocalTransactions=true
resource.ds1.automaticEnlistingEnabled=true
resource.ds1.applyTransactionTimeout=true
From what you're telling here, everything works as designed and as per the spec: the timeout exception should only happen when the transaction manager is asked to commit. BTM adds an extra facility to its pool to make any resource access also throw an exception, but that's pretty much the best it can do.
You're asking for your thread to be interrupted and an exception to be thrown after a certain time. The JVM is incapable of doing that.