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

SingleSessionCommandService Constructor Eats an Actual / Real Exception on Rollback

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

    XMLWordPrintable

Details

    • Workaround Exists
    • Hide

      Debug and see the stacktrace of t1

      Show
      Debug and see the stacktrace of t1
    • Low

    Description

      Scenario: The constructor of SingleSessionCommandService tries to persist the created SessionInfo and fails.
      Problem: Because of the failure, SingleSessionCommandService tries to rollback the TX. If the rollback also fail, an exception is thrown with the cause, but the original problem (The failure on SessionInfo persistence) is swallowed.
      The code of the catch section demonstrate this:

      try

      { this.txm.begin(); //this.appScopedEntityManager.joinTransaction(); registerRollbackSync(); jpm.getApplicationScopedPersistenceContext().persist( this.sessionInfo ); this.txm.commit(); }

      catch ( Exception t1 ) {
      try

      { this.txm.rollback(); }

      catch ( Throwable t2 )

      { throw new RuntimeException( "Could not commit session or rollback", t2 ); }

      throw new RuntimeException( "Could not commit session",
      t1 );
      }

      If this.txm.rollback() fails, t1 is never logged.

      A similar issue was fixed in JBRULES-2656

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Archived:

                PagerDuty