use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientXACompatibilityTest method testManualCommitShouldThrowException.
@Test(expected = UnsupportedOperationException.class)
public void testManualCommitShouldThrowException() throws Exception {
xaResource.start(xid, TMNOFLAGS);
TransactionContext transactionContext = xaResource.getTransactionContext();
transactionContext.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientXACompatibilityTest method testCommit_TwoPhase_NonPrepared.
@Test(expected = TransactionException.class)
public void testCommit_TwoPhase_NonPrepared() throws Exception {
xaResource.start(xid, TMNOFLAGS);
TransactionContext context = xaResource.getTransactionContext();
TransactionalMap<Object, Object> map = context.getMap("map");
map.put("key", "val");
xaResource.end(xid, TMSUCCESS);
xaResource.commit(xid, false);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientXACompatibilityTest method doSomeWorkWithXa.
private void doSomeWorkWithXa(HazelcastXAResource xaResource) throws Exception {
xaResource.start(xid, TMNOFLAGS);
TransactionContext context = xaResource.getTransactionContext();
TransactionalMap<Object, Object> map = context.getMap("map");
map.put("key", "value");
TransactionalQueue<Object> queue = context.getQueue("queue");
queue.offer("item");
TransactionalList<Object> list = context.getList("list");
list.add("item");
TransactionalSet<Object> set = context.getSet("set");
set.add("item");
TransactionalMultiMap<Object, Object> mm = context.getMultiMap("mm");
mm.put("key", "value");
xaResource.end(xid, TMSUCCESS);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientXACompatibilityTest method testManualRollbackShouldThrowException.
@Test(expected = UnsupportedOperationException.class)
public void testManualRollbackShouldThrowException() throws Exception {
xaResource.start(xid, TMNOFLAGS);
TransactionContext transactionContext = xaResource.getTransactionContext();
transactionContext.rollbackTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientXACompatibilityTest method testManualBeginShouldThrowException.
@Test(expected = UnsupportedOperationException.class)
public void testManualBeginShouldThrowException() throws Exception {
xaResource.start(xid, TMNOFLAGS);
TransactionContext transactionContext = xaResource.getTransactionContext();
transactionContext.beginTransaction();
}
Aggregations