Package javax.transaction

Examples of javax.transaction.Synchronization.afterCompletion()


    private void afterCompletion(List syncs) {
        for (Iterator i = syncs.iterator(); i.hasNext();) {
            Synchronization synch = (Synchronization) i.next();
            try {
                synch.afterCompletion(status);
            } catch (Exception e) {
                log.warn("Unexpected exception from afterCompletion; continuing", e);
            }
        }
    }
View Full Code Here


            for (Iterator iterator = syncMap.values().iterator(); iterator.hasNext();)
            {
                try
                {
                    synchronization = (Synchronization) iterator.next();
                    synchronization.afterCompletion(status);
                }
                catch (Exception e)
                {
                    failures = true;
                    log.error("Unexpected error when perform Synchronization#afterCompletion method" +
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();
    synchronization1.afterCompletion(Status.STATUS_COMMITTED);
View Full Code Here

    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());

    verify(session1).flush();
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());

    verify(session).flush();
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());

    verify(session).flush();
View Full Code Here

      }

      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

      Thread synch = new Thread() {

        @Override
        public void run() {
          synchronization.beforeCompletion();
          synchronization.afterCompletion(Status.STATUS_COMMITTED);
        }
      };
      synch.start();
      synch.join();
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());

    verify(session).flush();
View Full Code Here

      });
    }

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

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

    verify(session).close();
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.