use of com.hazelcast.transaction.impl.xa.XATransaction in project hazelcast by hazelcast.
the class PutRemoteTransactionBackupOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
NodeEngine nodeEngine = getNodeEngine();
XATransaction transaction = new XATransaction(nodeEngine, records, txnId, xid, txOwnerUuid, timeoutMillis, startTime);
xaService.putTransaction(transaction);
}
use of com.hazelcast.transaction.impl.xa.XATransaction in project hazelcast by hazelcast.
the class PutRemoteTransactionOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
NodeEngine nodeEngine = getNodeEngine();
XATransaction transaction = new XATransaction(nodeEngine, records, txnId, xid, txOwnerUuid, timeoutMillis, startTime);
xaService.putTransaction(transaction);
}
use of com.hazelcast.transaction.impl.xa.XATransaction in project hazelcast by hazelcast.
the class FinalizeRemoteTransactionOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
final List<XATransaction> list = xaService.removeTransactions(xid);
if (list == null) {
sendResponse(getNodeEngine().toData(XAException.XAER_NOTA));
return;
}
final int size = list.size();
final ExecutionCallback callback = new ExecutionCallback() {
AtomicInteger counter = new AtomicInteger();
@Override
public void onResponse(Object response) {
sendResponseIfComplete();
}
@Override
public void onFailure(Throwable t) {
// TODO log the error
sendResponseIfComplete();
}
void sendResponseIfComplete() {
if (size == counter.incrementAndGet()) {
sendResponse(null);
}
}
};
for (XATransaction xaTransaction : list) {
finalizeTransaction(xaTransaction, callback);
}
}
use of com.hazelcast.transaction.impl.xa.XATransaction in project hazelcast by hazelcast.
the class XaReplicationOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
NodeEngine nodeEngine = getNodeEngine();
for (XATransactionDTO transactionDTO : migrationData) {
XATransaction transaction = new XATransaction(nodeEngine, transactionDTO.getRecords(), transactionDTO.getTxnId(), transactionDTO.getXid(), transactionDTO.getOwnerUuid(), transactionDTO.getTimeoutMilis(), transactionDTO.getStartTime());
xaService.putTransaction(transaction);
}
}
Aggregations