Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2657

DroolsSpringTransactionManager does not join an Existing Spring Transaction

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Hide

      run "SingleSessionCommandServiceRollbackIntegrationTest" from the zip attached

      Show
      run "SingleSessionCommandServiceRollbackIntegrationTest" from the zip attached
    • Hide

      First thing that comes to mind:

      DroolsSpringTransactionManager:

      public void rollback() {
      if ( this.localTransaction )

      { // if we didn't begin this transaction, then do nothing this.localTransaction = false; this.ptm.rollback( currentTransaction ); }

      }

      Show
      First thing that comes to mind: DroolsSpringTransactionManager: public void rollback() { if ( this.localTransaction ) { // if we didn't begin this transaction, then do nothing this.localTransaction = false; this.ptm.rollback( currentTransaction ); } }
    • Low

      DroolsSpringTransactionManager:

      public void begin() {
      if ( getStatus() == TransactionManager.STATUS_NO_TRANSACTION )

      { <<<<< IF Spring TX ALREADY EXISTS, "currentTransaction" NEVER GETS INITIALIZED ( GET A REFERENCE TO THE REAL TX ) // If there is no transaction then start one, we will commit within the same Command // it seems in spring calling getTransaction is enough to begin a new transaction currentTransaction = this.ptm.getTransaction( td ); localTransaction = true; }

      else

      { localTransaction = false; }

      }

      So in case "DroolsSpringTransactionManager" decides to, for example, rollback:

      public void rollback()

      { this.localTransaction = false; this.ptm.rollback( currentTransaction ); <<< IT'LL THROW A NULLPOINTEREXCEPTION HERE }

        1. drools-tm-current-tx-null.png
          50 kB
          Anat0ly
        2. root-cause.png
          53 kB
          Anat0ly
        3. tx-config.png
          7 kB
          Anat0ly

            esteban.aliverti@gmail.com Esteban Aliverti (Inactive)
            Anat0ly Anatoly Polinsky (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Resolved:
              Archived:

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified