[
https://jira.jboss.org/jira/browse/JBTM-664?page=com.atlassian.jira.plugi...
]
Jonathan Halliday commented on JBTM-664:
----------------------------------------
I'm not entirely convinced by the spec compliance argument. It's a question of the
interpretation of 'active transaction'. If that's taken to mean strictly
Status.STATUS_ACTIVE then you are right. However, Transaction.registerSynchronization
treats Status.STATUS_MARKED_ROLLBACK as a special case and mandates RollbackException in
such case. We feel it is indeed useful to distinguish that case, along with unexpected
errors not relating to state, from those in which some other state applies. Hence,
different exceptions. It's not clear if the spec authors consider the exception
throwing behaviour of Transaction.registerSynchronization an aberration they tried to
correct with TSR.registerInterposedSynchronization, or if the mismatch between the two is
unintentional. Either way, it does indeed provide for some headaches. Perhaps subclassing
IllegalStateException to communicate the intended differentiation would be better than
using RuntimeException.
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