public void afterTransactionBegin() { synchronizations.push(new SynchronizationRegistry()); }
public void afterTransactionCommit(boolean success) { if (!synchronizations.isEmpty()) { synchronizations.pop().afterTransactionCompletion(success); } }
public void beforeTransactionCommit() { if (!synchronizations.isEmpty()) { synchronizations.peek().beforeTransactionCompletion(); } }
@Override public void registerSynchronization(final Synchronization sync) { try { TransactionManager manager = getTransactionManager(); Transaction transaction = manager.getTransaction(); if (transactions.isEmpty() || transactions.peek().equals(transaction)) { transactions.push(transaction); synchronizations.push(new SynchronizationRegistry()); transaction.registerSynchronization(this); } synchronizations.peek().registerSynchronization(sync); } catch (Exception e) { throw new RuntimeException(e); } }
public void registerSynchronization(Synchronization sync) { synchronizations.getLast().registerSynchronization(sync); }
public void registerSynchronization(Synchronization sync) { if (synchronizations.isEmpty()) { throw new IllegalStateException("Transaction begin not detected, try installing transaction:ejb-transaction in components.xml"); } else { synchronizations.peek().registerSynchronization(sync); } }
public void afterTransactionRollback() { if (!synchronizations.isEmpty()) { synchronizations.pop().afterTransactionCompletion(false); } }
public void beforeCompletion() throws EJBException, RemoteException { log.debug("beforeCompletion"); SynchronizationRegistry sync = synchronizations.removeLast(); sync.beforeTransactionCompletion(); committing.addLast(sync); }
public void registerSynchronization(final Synchronization sync) { if (synchronizations.isEmpty()) { throw new IllegalStateException( "Transaction begin not detected, try installing transaction:ejb-transaction in components.xml"); } else { synchronizations.peek().registerSynchronization(sync); } }
public void afterBegin() { log.debug("afterBegin"); synchronizations.addLast( new SynchronizationRegistry() ); }
public void afterCompletion(boolean success) throws EJBException, RemoteException { log.debug("afterCompletion"); if ( committing.isEmpty() ) { if (success) { throw new IllegalStateException("beforeCompletion was never called"); } else { synchronizations.removeLast().afterTransactionCompletion(false); } } else { committing.removeFirst().afterTransactionCompletion(success); } }
public void beforeTransactionCommit() { if (!synchronizations.isEmpty()) { synchronizations.peek().beforeTransactionCompletion(); } }
public void afterTransactionBegin() { synchronizations.push(new SynchronizationRegistry()); }
public void afterTransactionCompletion(final boolean success) { if (!synchronizations.isEmpty()) { synchronizations.pop().afterTransactionCompletion(success); } }
@Override public void beforeCompletion() { log.debug("beforeCompletion"); SynchronizationRegistry sync = synchronizations.peek(); sync.beforeTransactionCompletion(); }
@Override public void afterCompletion(final int status) { transactions.pop(); log.debug("afterCompletion"); synchronizations.pop().afterTransactionCompletion((Status.STATUS_COMMITTED & status) == 0); }