Package javax.transaction

Examples of javax.transaction.Synchronization.beforeCompletion()


    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


      } 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

    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 = transaction.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization != null);
    synchronization.beforeCompletion();
    synchronization.afterCompletion(Status.STATUS_COMMITTED);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    }

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization != null);
    try {
      synchronization.beforeCompletion();
      fail("Should have thrown HibernateSystemException");
    }
    catch (HibernateSystemException ex) {
      assertSame(flushEx, ex.getCause());
    }
View Full Code Here

      }
    });

    Synchronization synchronization2 = transaction2.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization2 != null);
    synchronization2.beforeCompletion();
    synchronization2.afterCompletion(Status.STATUS_COMMITTED);

    Synchronization synchronization1 = transaction1.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization1 != null);
    synchronization1.beforeCompletion();
View Full Code Here

    synchronization2.beforeCompletion();
    synchronization2.afterCompletion(Status.STATUS_COMMITTED);

    Synchronization synchronization1 = transaction1.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization1 != null);
    synchronization1.beforeCompletion();
    synchronization1.afterCompletion(Status.STATUS_COMMITTED);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

      });
    }

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA Synchronization registered", synchronization != null);
    synchronization.beforeCompletion();
    synchronization.afterCompletion(Status.STATUS_COMMITTED);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

      }
    });

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization != null);
    synchronization.beforeCompletion();
    synchronization.afterCompletion(Status.STATUS_COMMITTED);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

      sessionControl.setReturnValue(null, 1);
      sessionControl.replay();

      Synchronization synchronization = transaction.getSynchronization();
      assertTrue("JTA synchronization registered", synchronization != null);
      synchronization.beforeCompletion();
      synchronization.afterCompletion(Status.STATUS_COMMITTED);
      assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
    }
    finally {
      TransactionSynchronizationManager.unbindResource(sf);
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.