protected UserTransaction createCMTTransaction() throws NamingException { return new CMTTransaction( EJB.getEJBContext() ); }
@Override public void registerSynchronization(Synchronization sync) { Synchronizations synchronizations = getSynchronizations(); if (synchronizations.isAwareOfContainerTransactions()) { synchronizations.registerSynchronization(sync); } else { throw new UnsupportedOperationException("cannot register synchronization with container transaction, use <transaction:ejb-transaction/>"); } }
public CMTTransaction(EJBContext ejbContext, Synchronizations sync) { setSynchronizations(sync); this.ejbContext = ejbContext; if (ejbContext == null) { throw new IllegalArgumentException("null EJBContext"); } }
@Override public void registerSynchronization(Synchronization sync) { Synchronizations synchronizations = getSynchronizations(); if ( synchronizations.isAwareOfContainerTransactions() ) { synchronizations.registerSynchronization(sync); } else { throw new UnsupportedOperationException("cannot register synchronization with container transaction, use <transaction:ejb-transaction/>"); } }
protected SeamTransaction createCMTTransaction() throws NamingException { return new CMTTransaction(getEJBContext(), synchronizations); }
public void begin() throws NotSupportedException, SystemException { ejbContext.getUserTransaction().begin(); getSynchronizations().afterTransactionBegin(); }
public void rollback() throws IllegalStateException, SecurityException, SystemException { UserTransaction userTransaction = ejbContext.getUserTransaction(); try { userTransaction.rollback(); } finally { getSynchronizations().afterTransactionRollback(); } }
public void rollback() throws IllegalStateException, SecurityException, SystemException { UserTransaction userTransaction = ejbContext.getUserTransaction(); try { userTransaction.rollback(); } finally { getSynchronizations().afterTransactionCompletion(false); } }
public void begin() throws NotSupportedException, SystemException { ejbContext.getUserTransaction().begin(); getSynchronizations().afterTransactionBegin(); }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { UserTransaction userTransaction = ejbContext.getUserTransaction(); boolean success = false; Synchronizations synchronizations = getSynchronizations(); synchronizations.beforeTransactionCommit(); try { userTransaction.commit(); success = true; } finally { synchronizations.afterTransactionCompletion(success); } }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { UserTransaction userTransaction = ejbContext.getUserTransaction(); boolean success = false; Synchronizations synchronizations = getSynchronizations(); synchronizations.beforeTransactionCommit(); try { userTransaction.commit(); success = true; } finally { synchronizations.afterTransactionCommit(success); } }