/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
/** * @return a new object instance */ public DataStructure createObject() { return new TransactionInfo(); }
public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { trace(new TransactionInfo(context.getConnectionId(), xid, onePhase ? TransactionInfo.COMMIT_ONE_PHASE : TransactionInfo.COMMIT_TWO_PHASE)); super.commitTransaction(context, xid, onePhase); }
public void forgetTransaction(ConnectionContext context, TransactionId xid) throws Exception { trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.FORGET)); super.forgetTransaction(context, xid); }
public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.PREPARE)); return super.prepareTransaction(context, xid); }
public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.BEGIN)); super.beginTransaction(context, xid); }
public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { trace(new TransactionInfo(context.getConnectionId(), xid, TransactionInfo.ROLLBACK)); super.rollbackTransaction(context, xid); }
@Override public Xid[] recover(int flag) throws XAException { LOG.debug("recover({})", flag); XATransactionId[] answer; if (XAResource.TMNOFLAGS == flag) { // signal next in cursor scan, which for us is always the end b/c we don't maintain any cursor state // allows looping scan to complete answer = new XATransactionId[0]; } else { TransactionInfo info = new TransactionInfo(getConnectionId(), null, TransactionInfo.RECOVER); try { this.connection.checkClosedOrFailed(); this.connection.ensureConnectionInfoSent(); DataArrayResponse receipt = (DataArrayResponse) this.connection.syncSendPacket(info); DataStructure[] data = receipt.getData(); if (data instanceof XATransactionId[]) { answer = (XATransactionId[]) data; } else { answer = new XATransactionId[data.length]; System.arraycopy(data, 0, answer, 0, data.length); } } catch (JMSException e) { throw toXAException(e); } } LOG.debug("recover({})={}", flag, answer); return answer; }
@Override public void forget(Xid xid) throws XAException { LOG.debug("Forget: {}", xid); // We allow interleaving multiple transactions, so // we don't limit forget to the associated xid. XATransactionId x; if (xid == null) { throw new XAException(XAException.XAER_PROTO); } if (equals(associatedXid, xid)) { // TODO determine if this can happen... I think not. x = (XATransactionId)transactionId; } else { x = new XATransactionId(xid); } TransactionInfo info = new TransactionInfo(getConnectionId(), x, TransactionInfo.FORGET); try { // Tell the server to forget the transaction. this.connection.syncSendPacket(info); } catch (JMSException e) { throw toXAException(e); } synchronized(ENDED_XA_TRANSACTION_CONTEXTS) { ENDED_XA_TRANSACTION_CONTEXTS.remove(x); } }
transactionId = new XATransactionId(xid); TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN); try { this.connection.asyncSendPacket(info); TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.END); try { this.connection.syncSendPacket(info);
transactionId, (synchronizations != null ? synchronizations.size() : 0)); TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.ROLLBACK); this.transactionId = null;
TransactionInfo info = new TransactionInfo(getConnectionId(), x, TransactionInfo.ROLLBACK); this.connection.syncSendPacket(info);
/** * Start a local transaction. * @throws javax.jms.JMSException on internal error */ public void begin() throws JMSException { if (isInXATransaction()) { throw new TransactionInProgressException("Cannot start local transaction. XA transaction is already in progress."); } if (transactionId == null) { synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); this.transactionId = new LocalTransactionId(getConnectionId(), localTransactionIdGenerator.getNextSequenceId()); TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN); this.connection.ensureConnectionInfoSent(); this.connection.asyncSendPacket(info); // Notify the listener that the tx was started. if (localTransactionEventListener != null) { localTransactionEventListener.beginEvent(); } LOG.debug("Begin:{}", transactionId); } }