[jbossts-issues] [JBoss JIRA] Updated: (JBTM-667) Hibernate exception stack is overridden by SetRollbackOnly

Jonathan Halliday (JIRA) jira-events at lists.jboss.org
Mon Jan 4 05:19:30 EST 2010

     [ https://jira.jboss.org/jira/browse/JBTM-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Halliday updated JBTM-667:

    Fix Version/s:     (was:  4.6.1.CP04)

> Hibernate exception stack is overridden by SetRollbackOnly
> ----------------------------------------------------------
>                 Key: JBTM-667
>                 URL: https://jira.jboss.org/jira/browse/JBTM-667
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JTA
>    Affects Versions: 4.6.0
>         Environment: OS: windows XP.
> Intel CPU 
>            Reporter: Terry Xie
>            Assignee: Jonathan Halliday
> The fix in https://jira.jboss.org/jira/browse/JBTM-66 makes the hibernate persistence exception lost in exception stack. For example, say there is a duplicate data constraint violation, hibernate entity manager calls calls transaction manager setRollbackOnly .  However setRollbackOnly in TransactionImple.java sets the _rollbackOnlyCallerStacktrace which will be thrown as the exception cause later instead of the hibernate exception source. This makes the hibernate persistence exception unable to propagate to jboss clients. In this case, it is much more useful for hibernate exception information to be displayed to clients instead of the setRollbackOnly stack.  
> The method in TransactionImple.java which throws the  rollbackOnlyCallerStacktrace instead of _theTransaction.getDeferredThrowable() 
> protected void commitAndDisassociate()
>                   throws javax.transaction.RollbackException,
>                   javax.transaction.HeuristicMixedException,
>                   javax.transaction.HeuristicRollbackException,
>                   java.lang.SecurityException, javax.transaction.SystemException,
>                   java.lang.IllegalStateException
>       {
>            .  .  . 
>                      if(_rollbackOnlyCallerStacktrace != null) {
>                             // we rolled back beacuse the user explicitly told us not to commit. Attach the trace of who did that for debug:
>                             rollbackException.initCause(_rollbackOnlyCallerStacktrace);
>                         }
>                         else if(_theTransaction.getDeferredThrowable() != null) {
>                             // we tried to commit but it went wrong - attach the reason for debug:
>                                           rollbackException.initCause(_theTransaction.getDeferredThrowable());
>                                     }
> Here should be the change related to issue JBTM-66 :
> http://viewvc.jboss.org/cgi-bin/viewvc.cgi/labs/labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java?r1=25057&r2=25056&pathrev=25057

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


More information about the jbossts-issues mailing list