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

Details

    • 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

    Description

      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 }

      Attachments

        1. drools-spring-tm-jira.zip
          36 kB
        2. drools-tm-current-tx-null.png
          drools-tm-current-tx-null.png
          50 kB
        3. root-cause.png
          root-cause.png
          53 kB
        4. tx-config.png
          tx-config.png
          7 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Archived:

                Time Tracking

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

                  PagerDuty