Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5483

RulesByteArray is never persistent into SessionInfo Table

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.39.0.Final
    • core engine
    • None
    • 2020 Week 28-30 (from Jul 6)
    • Hide
      public void commit(boolean transactionOwner) {
          if ( transactionOwner ) {
              try {
                  this.ut.commit();
              } catch ( Exception e ) {
                  logger.warn( "Unable to commit transaction", e);
                  throw new RuntimeException( "Unable to commit transaction",
                                              e );
              } finally {
                  transactionResources.get().clear();
              }
          }
      }
      

      We should only perform commit and clear the transaction only if the caller own the transaction

      Show
      public void commit( boolean transactionOwner) {     if ( transactionOwner ) {         try {             this .ut.commit();         } catch ( Exception e ) {             logger.warn( "Unable to commit transaction" , e);             throw new RuntimeException( "Unable to commit transaction" ,                                         e );         } finally {             transactionResources.get().clear();         }     } } We should only perform commit and clear the transaction only if the caller own the transaction
    • NEW
    • NEW

    Description

      Hello,

      When I deploy KIE Application into Karaf which doesn't support build-in capability of TransactionSynchronizationRegistry, so it will fallback into implementation with ThreadLocal

      https://github.com/kiegroup/drools/blob/master/drools-persistence/drools-persistence-api/src/main/java/org/drools/persistence/jta/JtaTransactionManager.java

       

      What's happening is during commit, the transaction resource is always clear no matter the caller own the transaction or not.

       

      public void commit(boolean transactionOwner) {
          if ( transactionOwner ) {
              try {
                  this.ut.commit();
              } catch ( Exception e ) {
                  logger.warn( "Unable to commit transaction", e);
                  throw new RuntimeException( "Unable to commit transaction",
                                              e );
              }
          }
          transactionResources.get().clear();
      }
      

      This causes rulesbytearray field in sessioninfo table is not persisted.
      Please refer to comment from ngs-mtech on JtaTransactionManager.java

      https://github.com/kiegroup/drools/commit/6189bdfaed78d540b464b83bcf6de5b34ee6888b

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            agustino.alim@finantix.com Agustino Alim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: