[jbossts-issues] [JBoss JIRA] Commented: (JBTM-575) javax.transaction.RollbackException root cause
Misty Stanley-Jones (JIRA)
jira-events at lists.jboss.org
Wed Dec 8 20:04:31 EST 2010
[ https://jira.jboss.org/browse/JBTM-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568825#comment-12568825 ]
Misty Stanley-Jones commented on JBTM-575:
Whoops, this was a JIRA fail. I will rewrite with the contents of https://jira.jboss.org/browse/JBTM-575?focusedCommentId=12556090&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12556090:
Cause: In ArjunaCore which was included in JBoss Application Server 4.2 and previous, when a transaction rolled back, the <systemitem>RollbackException</systemitem> included the root cause of the exception, in the form of the class which caused it. In JBoss Application Server 5.1, the exception no longer included this information, even though the information can still be found in a different area of the log file.
Consequence: Developers who relied on the information included in the <systemitem>RollbackException</systemitem> in the older versions of JBoss Application Server found that their applications no longer worked as expected.
Fix: The debugging information has been put back into the exception, so that it works as it did previously. The following algorithm is used:
1. If setRollbackOnly() is called before commit(), the initCause is 'setRollbackOnly called from...' regardless of anything that may go wrong during the commit. beforeCompletions are not called.
2. If getDeferredThrowable is not null, the initCause is the deferredThrowable, Even if setRollbackOnly is also called before the exception is received.
3. If setRollbackOnly was called, it is the root cause. This covers the case where a beforeCompletion calls setRollbackOnly but does not throw an exception.
Result: The root cause of the exception is once again included, so developers can once again write code to take advantage of the debugging information found in the <systemitem>RollbackException</systemitem>.
> javax.transaction.RollbackException root cause
> Key: JBTM-575
> URL: https://jira.jboss.org/browse/JBTM-575
> Project: JBoss Transaction Manager
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: JTA
> Affects Versions: 4.7.0
> Environment: JBoss 5.1.0.GA
> Reporter: Richard Kennard
> Assignee: Jonathan Halliday
> Fix For: 4.14.0
> In JBoss 4.2.3.GA and previous releases, when a transaction rolled back the RollbackException included the root cause of the exception. This enhancement was implemented in response to JBAS-4238 and JBTM-66.
> However, in JBoss 5.1.0.GA this enhancement has been lost in some scenarios. This does not affect manual debugging (the root cause is still logged higher up in the logs), but makes it difficult for application code that relies on being able to unwrap the RollbackException to determine its root cause and therefore take appropriate action.
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbossts-issues