Package javax.transaction

Examples of javax.transaction.Synchronization.beforeCompletion()


     */
    public void beforeCompletion() {
        int size = synchronizations.size();
        for (int i = 0; i < size; ++i) {
            Synchronization instance = (Synchronization) synchronizations.get(i);
            instance.beforeCompletion();
        }
    }
   
    /** This method will be called during transaction completion.  No resource
     * access is allowed.
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) {
                    status = Status.STATUS_MARKED_ROLLBACK;
                }
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

      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

        Iterator<Synchronization> it = synchronizationScheduler.reverseIterator();
        while (it.hasNext()) {
            Synchronization synchronization = it.next();
            try {
                if (log.isDebugEnabled()) { log.debug("executing synchronization " + synchronization); }
                synchronization.beforeCompletion();
            } catch (RuntimeException ex) {
                if (log.isDebugEnabled()) { log.debug("Synchronization.beforeCompletion() call failed for " + synchronization + ", marking transaction as rollback only - " + ex); }
                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 {
                    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

            for (Iterator iterator = syncMap.values().iterator(); iterator.hasNext();)
            {
                try
                {
                    synchronization = (Synchronization) iterator.next();
                    synchronization.beforeCompletion();
                }
                catch (Exception e)
                {
                    failures = true;
                    log.error("Unexpected error when perform Synchronization#beforeCompletion method" +
View Full Code Here

        // now call beforeCompletion for all pmSyncs
        for ( int i=0; i<pmSyncs.size(); i++ ) {
            Synchronization sync = (Synchronization)pmSyncs.elementAt(i);
            try {
                sync.beforeCompletion();
            } catch ( RuntimeException ex ) {
                logAndRollbackTransaction(ex);
                throw ex;
            } catch ( Exception ex ) {
                logAndRollbackTransaction(ex);
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

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.