[jboss-jira] [JBoss JIRA] Commented: (JBAS-4481) Transaction timeouts leave garbage Status.ROLLEDBACK UserTransaction object bound to the thread
Mark Little (JIRA)
jira-events at lists.jboss.org
Wed Jun 13 05:28:11 EDT 2007
[ http://jira.jboss.com/jira/browse/JBAS-4481?page=comments#action_12365157 ]
Mark Little commented on JBAS-4481:
-----------------------------------
In a multi-threaded environment where multiple threads may be running in the scope of the same transaction you can't just arbitrarily change the transaction association for a running thread. That would be *bad* for the application and potentially consistency. What JBossTS does (and has always done) is roll back the transaction that has timed out and leave it associated with the various threads. Those threads can then determine that the transaction has terminated and do whatever makes sense in terms of cleanup for them before breaking the association via UT or TM commit, rollback or suspend. There is no other portable way of doing this. Plus, XA checked transaction semantics actually make it illegal for any thread other than the creating/resuming thread to change the association for itself.
Your application thread(s) doesn't have to do anything special about a timed-out transaction that it wouldn't normally do anyway, i.e., it just needs to terminate the transaction when it's finished with it. Your code is either going to call commit or rollback anyway before putting the thread back into the pool. That will still do the disassociation for you.
The old JBossTM code used to mark the transaction as rollback-only, which wouldn't do the thread-to-transaction disassociation (at least from within the JTA). I haven't looked at that bit of the code in a while, but if it also changed the association then that's a non-portable implementation choice beyond what the specification defines.
> Transaction timeouts leave garbage Status.ROLLEDBACK UserTransaction object bound to the thread
> -----------------------------------------------------------------------------------------------
>
> Key: JBAS-4481
> URL: http://jira.jboss.com/jira/browse/JBAS-4481
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Transaction Manager
> Affects Versions: JBossAS-4.2.0.GA
> Reporter: Gavin King
> Assigned To: Jonathan Halliday
> Priority: Blocker
> Fix For: JBossAS-4.2.1.CR1
>
>
> If a transaction timeout occurs, the UserTransaction object does not get cleaned up from the thread, even after the request ends and the thread returns to the pool. Future requests will not be able to begin() a transaction, since the STATUS_ROLLEDBACK UserTransaction throws this exception:
> Caused by: javax.transaction.NotSupportedException
> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:79)
> at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:77)
> at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:124)
> at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:29)
> This means that any transaction timeout that occurs will leave the application server in a permanently broken state and require a server restart. Hence 4.2.0.GA is currently unusable in production!
> This needs to be fixed in an immediate patch release.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list