use of javax.transaction.Transaction in project geode by apache.
the class TransactionManagerImpl method getGlobalTransaction.
/**
* Get the Global Transaction associated with the calling thread
*/
GlobalTransaction getGlobalTransaction() throws SystemException {
Transaction txn = getTransaction();
if (txn == null) {
return null;
}
GlobalTransaction gtx = (GlobalTransaction) globalTransactionMap.get(txn);
return gtx;
}
use of javax.transaction.Transaction in project geode by apache.
the class ExceptionJUnitTest method testAddNullTransaction.
@Test
public void testAddNullTransaction() throws Exception {
try {
utx.begin();
GlobalTransaction gtx = tm.getGlobalTransaction();
Transaction txn = null;
gtx.addTransaction(txn);
utx.commit();
fail("SystemException not thrown on adding null transaction");
} catch (SystemException e) {
utx.commit();
}
}
use of javax.transaction.Transaction in project geode by apache.
the class GlobalTransactionJUnitTest method testSuspend.
@Test
public void testSuspend() throws Exception {
utx.begin();
tm.suspend();
Transaction txn1 = tm.getTransaction();
if (txn1 != null)
fail("suspend failed to suspend the transaction");
}
use of javax.transaction.Transaction in project geode by apache.
the class GlobalTransactionJUnitTest method testSetRollbackOnly.
@Test
public void testSetRollbackOnly() throws Exception {
utx.begin();
utx.setRollbackOnly();
Transaction txn = tm.getTransaction();
if (txn.getStatus() != Status.STATUS_MARKED_ROLLBACK) {
utx.rollback();
fail("testSetRollbackonly failed");
}
utx.rollback();
}
use of javax.transaction.Transaction in project wildfly by wildfly.
the class StatelessBean method testTransaction.
public void testTransaction() throws RemoteException, SystemException {
log.trace("Method stateless #testTransaction called");
Transaction txn;
txn = tm.getTransaction();
TxTestUtil.enlistTestXAResource(txn, checker);
TxTestUtil.enlistTestXAResource(txn, checker);
}
Aggregations