public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { TransactionManager tm = con.getTransactionManager(); try { Transaction tx = tm.getTransaction(); if (trace) log.trace("UserTx commit: " + tx); int status = tm.getStatus(); tm.commit(); } finally { // According to the spec, after commit and rollback was called on // UserTransaction, the thread is associated with no transaction. // Since the BMT Tx interceptor will associate and resume the tx // from the context with the thread that comes in // on a subsequent invocation, we must set the context transaction to null setTransaction(null); } }
public void rollback() throws IllegalStateException, SecurityException, SystemException { TransactionManager tm = con.getTransactionManager(); try { Transaction tx = tm.getTransaction(); if (trace) log.trace("UserTx rollback: " + tx); tm.rollback(); } finally { // According to the spec, after commit and rollback was called on // UserTransaction, the thread is associated with no transaction. // Since the BMT Tx interceptor will associate and resume the tx // from the context with the thread that comes in // on a subsequent invocation, we must set the context transaction to null setTransaction(null); } }
public void begin() throws NotSupportedException, SystemException { TransactionManager tm = con.getTransactionManager(); int oldTimeout = -1; if (tm instanceof TransactionTimeoutConfiguration) oldTimeout = ((TransactionTimeoutConfiguration) tm).getTransactionTimeout(); // Set the timeout value tm.setTransactionTimeout(timeout); try { // Start the transaction tm.begin(); //notify checked out connections EJB2UserTransactionProvider.getSingleton().userTransactionStarted(); if (tsl != null) tsl.userTransactionStarted(); Transaction tx = tm.getTransaction(); if (trace) log.trace("UserTx begin: " + tx); // keep track of the transaction in enterprise context for BMT setTransaction(tx); } finally { // Reset the transaction timeout (if we know what it was) if (oldTimeout != -1) tm.setTransactionTimeout(oldTimeout); } }
ctx.setTransaction(mi.getTransaction());
ctx.setTransaction(mi.getTransaction()); else if(ejbObjectRemove.equals(miMethod) || ejbLocalObjectRemove.equals(miMethod))
ctx.setTransaction(mi.getTransaction());