[
https://jira.jboss.org/jira/browse/JBTM-664?page=com.atlassian.jira.plugi...
]
Mark Little commented on JBTM-664:
----------------------------------
A transaction is still logically active if in the rollback-only state. That status does
not signify that the transaction has begun to terminate. If you assume that
STATUS_MARKED_ROLLBACK makes the transaction inactive then by that logic it should be
illegal to call setRollbackOnly multiple times (it should throw IllegalStateException
subsequently). In fact that isn't the case and as long as the transaction has not
terminated, or begun to terminate, it's correct to allow that to be called multiple
times. A transaction is considered inactive once it begins the two-phase commit protocol
(commit is called) or is rolled back. I think the JTA 1.1 update author(s) made the
already poorly written JTA worse in this regard: registerInterposedSynchronization should
have the same signature in terms of exceptions as registerSynchronization.
We should consider raising this with Sun if we haven't already. In the meantime I
think Jonathan is right and the best recourse is to subtype IllegalStateException so that
information is not lost. There's a reason we chose to throw TRANSACTION_ROLLEBACK in
OTS and hence in JTA!
The JTA transaction synchronization don't respect the JTA 1.1
specification
---------------------------------------------------------------------------
Key: JBTM-664
URL:
https://jira.jboss.org/jira/browse/JBTM-664
Project: JBoss Transaction Manager
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: JTA
Affects Versions: 4.5.0, 4.6.1.CP04
Environment: jboss AS 5.0.1 GA
Reporter: Olivier BILLIARD
Priority: Critical
Attachments: TransactionSynchronizationRegistryImple.java
According to the JTA 1.1 specification, the registerInterposedSynchronization must throw
an IllegalStateException if the no transaction is active (
http://java.sun.com/javaee/5/docs/api/javax/transaction/TransactionSynchr...
). The current code throw a RuntimeException. It's a problem because some third party
framework, like Spring, only catch RollbackException, SystemException and
IllegalStateException.
It'll be great to modify the registerInterposedSynchronization method for throwing
the expected exception.
I attach the corrected source file.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira