Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3274

the Exception on rollback hides the original Exception on commit in DbPersistenceService.endTransaction()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.11
    • jBPM 3.2.10
    • Runtime Engine
    • None

      JBPM-2964 doesn't solve the original problem explained in the 'Description'.

      ======
      In case that commit() throws an exception (e.g. StaleObjectStateException) in DbPersistenceService.endTransaction(), rollback() will be called. And then, if rollback() also throws an exception, a client application will get the latter exception (Usually, it would be java.lang.IllegalStateException: BaseTransaction.rollback - [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] no transaction! ).

        public void endTransaction() {
          if (!isTransactionRollbackOnly()) {
            Exception commitException = commit();
            if (commitException != null) {
              rollback();
              closeSession();
              closeConnection();
              throw new JbpmPersistenceException("transaction commit failed", commitException);
            }
          }
      ...
      

      It is not a desirable behaviour. It's better to catch the exception on rollback, log it and throw the exception on commit.
      ======

      Alejandro seemed to misunderstand my intention. The problem is that the Exception on rollback hides the original Exception on commit.
      Please re-consider it.

            marco.rietveld Marco Rietveld (Inactive)
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: