use of org.apache.geode.internal.jta.SyncImpl in project geode by apache.
the class ClientServerTransactionDUnitTest method doJTATx2.
private void doJTATx2(String regionName, CountDownLatch latch1, CountDownLatch latch2) {
try {
TransactionManagerImpl tm = TransactionManagerImpl.getTransactionManager();
UserTransaction utx = new UserTransactionImpl();
Region r = getClientRegion(regionName);
utx.begin();
r.put(key1, "value3");
TransactionImpl txn = (TransactionImpl) tm.getTransaction();
Synchronization sync = new SyncImpl();
txn.registerSynchronization(sync);
txn.notifyBeforeCompletionForTest();
latch1.countDown();
latch2.await();
utx.rollback();
} catch (Exception e) {
latch1.countDown();
Assert.fail("Unexpected exception while doing JTA Transaction2 ", e);
}
}
Aggregations