private final ActorContext actorContext;
private final ActorSelection actor;
- private final short remoteTransactionVersion;
private final OperationLimiter limiter;
private BatchedModifications batchedModifications;
protected RemoteTransactionContext(TransactionIdentifier identifier, ActorSelection actor,
ActorContext actorContext, short remoteTransactionVersion, OperationLimiter limiter) {
- super(identifier);
+ super(identifier, remoteTransactionVersion);
this.limiter = Preconditions.checkNotNull(limiter);
this.actor = actor;
this.actorContext = actorContext;
- this.remoteTransactionVersion = remoteTransactionVersion;
}
private Future<Object> completeOperation(Future<Object> operationFuture){
return actorContext;
}
- protected short getRemoteTransactionVersion() {
- return remoteTransactionVersion;
- }
-
protected Future<Object> executeOperationAsync(SerializableMessage msg) {
return completeOperation(actorContext.executeOperationAsync(getActor(), msg.toSerializable()));
}
LOG.debug("Tx {} closeTransaction called", getIdentifier());
TransactionContextCleanup.untrack(this);
- actorContext.sendOperationAsync(getActor(), new CloseTransaction(remoteTransactionVersion).toSerializable());
- }
-
- @Override
- public boolean supportsDirectCommit() {
- return true;
+ actorContext.sendOperationAsync(getActor(), new CloseTransaction(getTransactionVersion()).toSerializable());
}
@Override
}
private BatchedModifications newBatchedModifications() {
- return new BatchedModifications(getIdentifier().toString(), remoteTransactionVersion, getIdentifier().getChainId());
+ return new BatchedModifications(getIdentifier().toString(), getTransactionVersion(),
+ getIdentifier().getChainId());
}
private void batchModification(Modification modification) {
}
};
- Future<Object> future = executeOperationAsync(readCmd.asVersion(remoteTransactionVersion));
+ Future<Object> future = executeOperationAsync(readCmd.asVersion(getTransactionVersion()));
future.onComplete(onComplete, actorContext.getClientDispatcher());
}