Package javax.transaction

Examples of javax.transaction.Synchronization.beforeCompletion()


      Synchronization synchronization = flushSynch.get( session );
      if ( synchronization != null ) {
        //first cleanup
        flushSynch.remove( session );
        log.debug( "flush event causing index update out of transaction" );
        synchronization.beforeCompletion();
        synchronization.afterCompletion( Status.STATUS_COMMITTED );
      }
    }
  }
View Full Code Here


                    return;
                }
                synch = (Synchronization) syncList.get(i++);
            }
            try {
                synch.beforeCompletion();
            } catch (Exception e) {
                log.warn("Unexpected exception from beforeCompletion; transaction will roll back", e);
                synchronized (this) {
                    status = Status.STATUS_MARKED_ROLLBACK;
                }
View Full Code Here

            // (This code is straight from bitronix)
            Iterator<?> iter = bt.getSynchronizationScheduler().reverseIterator();
            while (iter.hasNext()) {
                Synchronization synchronization = (Synchronization) iter.next();
                try {
                    synchronization.beforeCompletion();
                } catch (RuntimeException ex) {
                    bt.setStatus(Status.STATUS_MARKED_ROLLBACK);
                    throw ex;
                }
            }
View Full Code Here

      Synchronization synchronization = flushSynch.get( session );
      if ( synchronization != null ) {
        //first cleanup
        flushSynch.remove( session );
        log.debug( "flush event causing index update out of transaction" );
        synchronization.beforeCompletion();
        synchronization.afterCompletion( Status.STATUS_COMMITTED );
      }
    }
  }
View Full Code Here

    else {
      status = Status.STATUS_PREPARING;

      for ( int i = 0; i < synchronizations.size(); i++ ) {
        Synchronization s = ( Synchronization ) synchronizations.get( i );
        s.beforeCompletion();
      }

      status = Status.STATUS_COMMITTING;

      if ( connection != null ) {
View Full Code Here

    Synchronization synchronization = flushSynch.get( session );
    if ( synchronization != null ) {
      //first cleanup
      flushSynch.remove( session );
      log.debug( "flush event causing index update out of transaction" );
      synchronization.beforeCompletion();
      synchronization.afterCompletion( Status.STATUS_COMMITTED );
    }
  }

  public SearchFactoryImplementor getSearchFactoryImplementor() {
View Full Code Here

                } else {
                    synch = (Synchronization) syncs.get(i++);
                }
            }
            try {
                synch.beforeCompletion();
            } catch (Exception e) {
                log.warn("Unexpected exception from beforeCompletion; transaction will roll back", e);
                synchronized (this) {
                    markRollbackCause(e);
                    status = Status.STATUS_MARKED_ROLLBACK;
View Full Code Here

      // env/06a2
      for (int i = 0; i < _interposedSynchronizations.size(); i++) {
        Synchronization sync = _interposedSynchronizations.get(i);

        try {
          sync.beforeCompletion();
        } catch (RuntimeException e) {
          setRollbackOnly(e);

          RollbackException newException = new RollbackException(e.toString());
          newException.initCause(e);
View Full Code Here

        if (log.isLoggable(Level.FINEST))
          log.finest(this + " beforeCompletion " + sync);

        try {
          sync.beforeCompletion();
        } catch (RuntimeException e) {
          setRollbackOnly(e);

          RollbackException newException = new RollbackException(e.toString());
          newException.initCause(e);
View Full Code Here

      } else {
         status = Status.STATUS_PREPARING;

         for (int i = 0; i < synchronizations.size(); i++) {
            Synchronization s = (Synchronization) synchronizations.get(i);
            s.beforeCompletion();
         }

         if (!runXaResourcePrepare()) {
            status = Status.STATUS_ROLLING_BACK;
         } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.