Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-21384

[GSS](7.4.z) HHH-14540 - Interceptor instance is shared between ORM session and Enver's temporary session resulting in multiple calls.

    XMLWordPrintable

Details

    Description

      If "Audited" Entity is used, CustomInterceptor#beforeTransactionCompletion() will be invoked 2 times due to the following code block:
      (In the beforeCompletion() method, beforeTransactionCompletion() will be invoked.)

      org.hibernate.internal.SessionImpl.addSharedSessionTransactionObserver()

      {{}}

      @Override
      protected void addSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator) {
      this.transactionObserver = new TransactionObserver() {
      @Override
      public void afterBegin() {
      }

      @Override
      public void beforeCompletion() {
      if ( isOpen() && getHibernateFlushMode() != FlushMode.MANUAL )

      { managedFlush(); }

      actionQueue.beforeTransactionCompletion();
      try

      { getInterceptor().beforeTransactionCompletion( getTransactionIfAccessible() ); }

      catch (Throwable t)

      { log.exceptionInBeforeTransactionCompletionInterceptor( t ); }

      }

      @Override
      public void afterCompletion(boolean successful, boolean delayed) {
      afterTransactionCompletion( successful, delayed );
      if ( !isClosed() && autoClose )

      { managedClose(); }

      }
      };
      transactionCoordinator.addObserver(transactionObserver);
      }

      Attachments

        Issue Links

          Activity

            People

              ccranfor@redhat.com Chris Cranford
              rhn-support-dstephan David Stephan
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: