@Override public void onResponse(Command response) { ConnectionId connectionId = info.getConnectionId(); ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { cs.removeTransactionState(info.getTransactionId()); } } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
if (lastCommand instanceof TransactionInfo) { TransactionInfo transactionInfo = (TransactionInfo) lastCommand; if (transactionInfo.getType() == TransactionInfo.COMMIT_ONE_PHASE) { if (LOG.isDebugEnabled()) { LOG.debug("rolling back potentially completed tx: " + transactionState.getId()); response.setException(new TransactionRolledBackException("Transaction completion in doubt due to failover. Forcing rollback of " + command.getTransactionId())); response.setCorrelationId(command.getCommandId()); transport.getTransportListener().onCommand(response);
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processBeginTransaction(TransactionInfo info) { if (trackTransactions && info != null && info.getTransactionId() != null) { ConnectionId connectionId = info.getConnectionId(); if (connectionId != null) { ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { cs.addTransactionState(info.getTransactionId()); TransactionState state = cs.getTransactionState(info.getTransactionId()); state.addCommand(info); } } return TRACKED_RESPONSE_MARKER; } return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processEndTransaction(TransactionInfo info) throws Exception { if (trackTransactions && info != null && info.getTransactionId() != null) { ConnectionId connectionId = info.getConnectionId(); if (connectionId != null) { ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { TransactionState transactionState = cs.getTransactionState(info.getTransactionId()); if (transactionState != null) { transactionState.addCommand(info); } } } return TRACKED_RESPONSE_MARKER; } return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processRollbackTransaction(TransactionInfo info) throws Exception { TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); context = cs.getContext(); cs.removeTransactionState(info.getTransactionId()); broker.rollbackTransaction(context, info.getTransactionId()); return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processCommitTransactionOnePhase(TransactionInfo info) throws Exception { TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); context = cs.getContext(); cs.removeTransactionState(info.getTransactionId()); broker.commitTransaction(context, info.getTransactionId(), true); return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processCommitTransactionTwoPhase(TransactionInfo info) throws Exception { TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); context = cs.getContext(); cs.removeTransactionState(info.getTransactionId()); broker.commitTransaction(context, info.getTransactionId(), false); return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
@Override public Response processBeginTransaction(TransactionInfo info) throws Exception { TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); context = null; if (cs != null) { context = cs.getContext(); } if (cs == null) { throw new NullPointerException("Context is null"); } // Avoid replaying dup commands if (cs.getTransactionState(info.getTransactionId()) == null) { cs.addTransactionState(info.getTransactionId()); broker.beginTransaction(context, info.getTransactionId()); } return null; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { TransactionInfo info = (TransactionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); return rc + 1; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { TransactionInfo info = (TransactionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); dataOut.writeByte(info.getType()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { TransactionInfo info = (TransactionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); return rc + 1; }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); TransactionInfo info = (TransactionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs); dataOut.writeByte(info.getType()); }