use of com.hazelcast.transaction.impl.xa.operations.ClearRemoteTransactionOperation in project hazelcast by hazelcast.
the class XAClearRemoteTransactionMessageTask method call.
@Override
protected Object call() throws Exception {
InternalOperationService operationService = nodeEngine.getOperationService();
InternalPartitionService partitionService = nodeEngine.getPartitionService();
ClientEndpoint endpoint = getEndpoint();
Data xidData = serializationService.toData(parameters.xid);
Operation op = new ClearRemoteTransactionOperation(xidData);
op.setCallerUuid(endpoint.getUuid());
int partitionId = partitionService.getPartitionId(xidData);
InvocationBuilder builder = operationService.createInvocationBuilder(getServiceName(), op, partitionId);
builder.setTryCount(TRY_COUNT).setResultDeserialized(false);
builder.invoke();
return XATransactionClearRemoteCodec.encodeResponse();
}
use of com.hazelcast.transaction.impl.xa.operations.ClearRemoteTransactionOperation in project hazelcast by hazelcast.
the class XAResourceImpl method clearRemoteTransactions.
private void clearRemoteTransactions(Xid xid) {
NodeEngine nodeEngine = getNodeEngine();
IPartitionService partitionService = nodeEngine.getPartitionService();
OperationService operationService = nodeEngine.getOperationService();
SerializableXID serializableXID = new SerializableXID(xid.getFormatId(), xid.getGlobalTransactionId(), xid.getBranchQualifier());
Data xidData = nodeEngine.toData(serializableXID);
int partitionId = partitionService.getPartitionId(xidData);
ClearRemoteTransactionOperation operation = new ClearRemoteTransactionOperation(xidData);
operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
}
Aggregations