[
http://jira.jboss.com/jira/browse/JBAS-4481?page=comments#action_12365540 ]
Gavin King commented on JBAS-4481:
----------------------------------
"however, it will be seeing a transaction in state STATUS_ROLLEDBACK, which it does
not know how to deal with. It should really call rollback in this case"
Yes, this is what is missing.
"However, the application code should not be giving it a dirty Thread in the first
place."
Irrelevant, because:
(1) It is actually, strictly speaking, *impossible* for a JSF application to clean up
transactions properly, since the only place to put a finally block around the whole
transaction would be in a servlet filter, and applications are not supposed to do tx
management in servlet filters (though all appservers let you do it in practice).
(2) I guarantee you that if you survey 100 experienced Java EE developers, you will not
find a single one who thinks that it is necessary to call rollback() on a transaction that
is STATUS_ROLLEDBACK.
(3) If you survey 100 Java EE applications which do transaction management via
UserTransaction, you will find at least 300 bugs in the transaction management code.
(4) And, frankly, I disagree that this is required of the application anyway. The EE spec
(read it, please) very clearly sets up the expectation that the container cleans up
transactions at the end of the request.
Regardless of the above, ALL applications have bugs! The container cannot expect the
application to be "well-behaved". It has to exhibit robust behavior even when
the application behaves badly. It should be utterly impossible for a "bug" in
one request to cause the failure of future requests. That escalates a minor bug into a
catastrophic failure of the production system.
I'm hammering on this stuff because this is the second time I have seen a problem like
this with the tx management code in JBoss AS, and both times people tried to argue that it
was the fault of the application, and that no fix was required to JBoss.
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: Gavin King
Priority: Blocker
Fix For: JBossAS-4.2.1.CR1
Attachments: test4481.tar
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