void inProgressClearRequired() { inProgressClearRequiredFlag.incrementAndGet(); // deal with delivered messages async to avoid lock contention with in progress acks clearDeliveredList = true; // force a rollback if we will be acking in a transaction after/during failover // bc acks are async they may not get there reliably on reconnect and the consumer // may not be aware of the reconnect in a timely fashion if in onMessage if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction()) { session.getTransactionContext().setRollbackOnly(true); } }
/** * Associates a transaction with the resource. */ @Override public void start(Xid xid, int flags) throws XAException { LOG.debug("Start: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } // Are we already associated? if (associatedXid != null) { throw new XAException(XAException.XAER_PROTO); } // if ((flags & TMJOIN) == TMJOIN) { // TODO: verify that the server has seen the xid // // } // if ((flags & TMRESUME) == TMRESUME) { // // TODO: verify that the xid was suspended. // } // associate synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); setXid(xid); }
/** * 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); } }
getTransactionContext().setRollbackOnly(true);
void inProgressClearRequired() { inProgressClearRequiredFlag.incrementAndGet(); // deal with delivered messages async to avoid lock contention with in progress acks clearDeliveredList = true; // force a rollback if we will be acking in a transaction after/during failover // bc acks are async they may not get there reliably on reconnect and the consumer // may not be aware of the reconnect in a timely fashion if in onMessage if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction()) { session.getTransactionContext().setRollbackOnly(true); } }
void inProgressClearRequired() { inProgressClearRequiredFlag.incrementAndGet(); // deal with delivered messages async to avoid lock contention with in progress acks clearDeliveredList = true; // force a rollback if we will be acking in a transaction after/during failover // bc acks are async they may not get there reliably on reconnect and the consumer // may not be aware of the reconnect in a timely fashion if in onMessage if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction()) { session.getTransactionContext().setRollbackOnly(true); } }
void inProgressClearRequired() { inProgressClearRequiredFlag.incrementAndGet(); // deal with delivered messages async to avoid lock contention with in progress acks clearDeliveredList = true; // force a rollback if we will be acking in a transaction after/during failover // bc acks are async they may not get there reliably on reconnect and the consumer // may not be aware of the reconnect in a timely fashion if in onMessage if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction()) { session.getTransactionContext().setRollbackOnly(true); } }
/** * Associates a transaction with the resource. */ @Override public void start(Xid xid, int flags) throws XAException { LOG.debug("Start: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } // Are we already associated? if (associatedXid != null) { throw new XAException(XAException.XAER_PROTO); } // if ((flags & TMJOIN) == TMJOIN) { // TODO: verify that the server has seen the xid // // } // if ((flags & TMRESUME) == TMRESUME) { // // TODO: verify that the xid was suspended. // } // associate synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); setXid(xid); }
/** * Associates a transaction with the resource. */ @Override public void start(Xid xid, int flags) throws XAException { LOG.debug("Start: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } // Are we already associated? if (associatedXid != null) { throw new XAException(XAException.XAER_PROTO); } // if ((flags & TMJOIN) == TMJOIN) { // TODO: verify that the server has seen the xid // // } // if ((flags & TMRESUME) == TMRESUME) { // // TODO: verify that the xid was suspended. // } // associate synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); setXid(xid); }
/** * Associates a transaction with the resource. */ @Override public void start(Xid xid, int flags) throws XAException { LOG.debug("Start: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } // Are we already associated? if (associatedXid != null) { throw new XAException(XAException.XAER_PROTO); } // if ((flags & TMJOIN) == TMJOIN) { // TODO: verify that the server has seen the xid // // } // if ((flags & TMRESUME) == TMRESUME) { // // TODO: verify that the xid was suspended. // } // associate synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); setXid(xid); }
/** * 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); } }
/** * 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); } }
/** * 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); } }
getTransactionContext().setRollbackOnly(true);
getTransactionContext().setRollbackOnly(true);
getTransactionContext().setRollbackOnly(true);