/**
* Replaces the global transaction in a VisitableCommand with a new global transaction passed in.
*/
private VisitableCommand replaceGtx(VisitableCommand command, final GlobalTransaction gtx) throws Throwable {
command.acceptVisitor(null, new AbstractVisitor() {
@Override
public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable {
command.setGlobalTransaction(gtx);
return null;
}