1 Reply Latest reply on Jun 24, 2009 3:00 AM by jaikiran pai

    JBoss 5.1 regression: ArjunaJTA loses stack trace

    Richard Kennard Novice

      There's some code in com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple that says...

      // keep a record of why we are rolling back i.e. who called us first, it's a useful debug aid.
      if(_rollbackOnlyCallerStacktrace == null)
      {
       _rollbackOnlyCallerStacktrace = new Throwable("setRollbackOnly called from:");
      }


      ...this seems to partner with some other code that says...

      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());
      }
      throw rollbackException;


      ...so we are attaching an empty Throwable with the text 'setRollbackOnly called from:' to the bottom of the stack trace. Contrary to the comments, this does not appear a useful debug aid. Rather, the 'deferredThrowable' might be more useful.

      In JBoss 4.2.3.GA the bottom of the stacktrace contained something useful (such as the SQL error that caused the rollback).

      Is this a bug?

      Regards,

      Richard.