Search in sources :

Example 6 with Transaction

use of com.hazelcast.transaction.impl.Transaction in project hazelcast by hazelcast.

the class XAResourceImpl method prepare.

@Override
public int prepare(Xid xid) throws XAException {
    List<TransactionContext> contexts = xidContextMap.get(xid);
    if (contexts == null) {
        throw new XAException("There is no TransactionContexts for the given xid: " + xid);
    }
    for (TransactionContext context : contexts) {
        Transaction transaction = getTransaction(context);
        transaction.prepare();
    }
    return XA_OK;
}
Also used : XAException(javax.transaction.xa.XAException) Transaction(com.hazelcast.transaction.impl.Transaction) TransactionContext(com.hazelcast.transaction.TransactionContext)

Aggregations

Transaction (com.hazelcast.transaction.impl.Transaction)6 TransactionContext (com.hazelcast.transaction.TransactionContext)5 TransactionException (com.hazelcast.transaction.TransactionException)3 XAException (javax.transaction.xa.XAException)2 MemberLeftException (com.hazelcast.core.MemberLeftException)1 TargetNotMemberException (com.hazelcast.spi.exception.TargetNotMemberException)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 TransactionManagerServiceImpl (com.hazelcast.transaction.impl.TransactionManagerServiceImpl)1