use of com.hazelcast.transaction.impl.xa.XAService in project hazelcast by hazelcast.
the class ClearRemoteTransactionBackupOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
xaService.removeTransactions(xid);
}
use of com.hazelcast.transaction.impl.xa.XAService in project hazelcast by hazelcast.
the class ClearRemoteTransactionOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
xaService.removeTransactions(xid);
}
use of com.hazelcast.transaction.impl.xa.XAService 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.XAService 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);
}
}
use of com.hazelcast.transaction.impl.xa.XAService in project hazelcast by hazelcast.
the class XATransactionCreateMessageTask method call.
@Override
protected Object call() throws Exception {
ClientEndpoint endpoint = getEndpoint();
XAService xaService = getService(getServiceName());
String ownerUuid = endpoint.getUuid();
TransactionContext context = xaService.newXATransactionContext(parameters.xid, ownerUuid, (int) parameters.timeout, true);
TransactionAccessor.getTransaction(context).begin();
endpoint.setTransactionContext(context);
return context.getTxnId();
}
Aggregations