public synchronized void dispose() throws JMSException { if (!closed) { try { executor.close(); for (Iterator<ActiveMQMessageConsumer> iter = consumers.iterator(); iter.hasNext();) { ActiveMQMessageConsumer consumer = iter.next(); consumer.setFailureError(connection.getFirstFailureError()); consumer.dispose(); lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); } consumers.clear(); for (Iterator<ActiveMQMessageProducer> iter = producers.iterator(); iter.hasNext();) { ActiveMQMessageProducer producer = iter.next(); producer.dispose(); } producers.clear(); try { if (getTransactionContext().isInLocalTransaction()) { rollback(); } } catch (JMSException e) { } } finally { connection.removeSession(this); this.transactionContext = null; closed = true; } } }
private void destroyConsumer() { if (consumer == null) { return; } try { if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { session.commit(); } consumer.close(); consumer = null; } catch (JMSException e) { e.printStackTrace(); } }
/** * 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); }
@Override public void end(Xid xid, int flags) throws XAException { LOG.debug("End: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } if ((flags & (TMSUSPEND | TMFAIL)) != 0) { // You can only suspend the associated xid. if (!equals(associatedXid, xid)) { throw new XAException(XAException.XAER_PROTO); } invokeBeforeEnd(); } else if ((flags & TMSUCCESS) == TMSUCCESS) { // set to null if this is the current xid. // otherwise this could be an asynchronous success call if (equals(associatedXid, xid)) { invokeBeforeEnd(); } } else { throw new XAException(XAException.XAER_INVAL); } }
/** * Associates a transaction with the resource. */ public void start(Xid xid, int flags) throws XAException { if (LOG.isDebugEnabled()) { LOG.debug("Start: " + xid); } 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 & TMJOIN) == TMRESUME) { // // TODO: verify that the xid was suspended. // } // associate synchronizations = null; beforeEndIndex = 0; setXid(xid); }
public synchronized void dispose() throws JMSException { if (!closed) { try { executor.close(); for (Iterator<ActiveMQMessageConsumer> iter = consumers.iterator(); iter.hasNext();) { ActiveMQMessageConsumer consumer = iter.next(); consumer.setFailureError(connection.getFirstFailureError()); consumer.dispose(); lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); } consumers.clear(); for (Iterator<ActiveMQMessageProducer> iter = producers.iterator(); iter.hasNext();) { ActiveMQMessageProducer producer = iter.next(); producer.dispose(); } producers.clear(); try { if (getTransactionContext().isInLocalTransaction()) { rollback(); } } catch (JMSException e) { } } finally { connection.removeSession(this); this.transactionContext = null; closed = true; } } }
public synchronized void dispose() throws JMSException { if (!closed) { try { executor.close(); for (Iterator<ActiveMQMessageConsumer> iter = consumers.iterator(); iter.hasNext();) { ActiveMQMessageConsumer consumer = iter.next(); consumer.setFailureError(connection.getFirstFailureError()); consumer.dispose(); lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); } consumers.clear(); for (Iterator<ActiveMQMessageProducer> iter = producers.iterator(); iter.hasNext();) { ActiveMQMessageProducer producer = iter.next(); producer.dispose(); } producers.clear(); try { if (getTransactionContext().isInLocalTransaction()) { rollback(); } } catch (JMSException e) { } } finally { connection.removeSession(this); this.transactionContext = null; closed = true; } } }
public synchronized void dispose() throws JMSException { if (!closed) { try { executor.close(); for (Iterator<ActiveMQMessageConsumer> iter = consumers.iterator(); iter.hasNext();) { ActiveMQMessageConsumer consumer = iter.next(); consumer.setFailureError(connection.getFirstFailureError()); consumer.dispose(); lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); } consumers.clear(); for (Iterator<ActiveMQMessageProducer> iter = producers.iterator(); iter.hasNext();) { ActiveMQMessageProducer producer = iter.next(); producer.dispose(); } producers.clear(); try { if (getTransactionContext().isInLocalTransaction()) { rollback(); } } catch (JMSException e) { } } finally { connection.removeSession(this); this.transactionContext = null; closed = true; } } }
private void destroyConsumer() { if (consumer == null) { return; } try { if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { session.commit(); } consumer.close(); consumer = null; } catch (JMSException e) { e.printStackTrace(); } }
/** * 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); }
private void destroyConsumer() { if (consumer == null) { return; } try { if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { session.commit(); } consumer.close(); consumer = null; } catch (JMSException e) { e.printStackTrace(); } }
public synchronized void dispose() throws JMSException { if (!closed) { try { executor.stop(); for (Iterator<ActiveMQMessageConsumer> iter = consumers.iterator(); iter.hasNext();) { ActiveMQMessageConsumer consumer = iter.next(); consumer.setFailureError(connection.getFirstFailureError()); consumer.dispose(); lastDeliveredSequenceId = Math.max(lastDeliveredSequenceId, consumer.getLastDeliveredSequenceId()); } consumers.clear(); for (Iterator<ActiveMQMessageProducer> iter = producers.iterator(); iter.hasNext();) { ActiveMQMessageProducer producer = iter.next(); producer.dispose(); } producers.clear(); try { if (getTransactionContext().isInLocalTransaction()) { rollback(); } } catch (JMSException e) { } } finally { connection.removeSession(this); this.transactionContext = null; closed = true; } } }
private void destroyConsumer() { if (consumer == null) { return; } try { if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { session.commit(); } consumer.close(); consumer = null; } catch (JMSException e) { e.printStackTrace(); } }
/** * 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); }
private void destroyConsumer() { if (consumer == null) { return; } try { if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) { session.commit(); } consumer.close(); consumer = null; } catch (JMSException e) { e.printStackTrace(); } }
@Override public void end(Xid xid, int flags) throws XAException { LOG.debug("End: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } if ((flags & (TMSUSPEND | TMFAIL)) != 0) { // You can only suspend the associated xid. if (!equals(associatedXid, xid)) { throw new XAException(XAException.XAER_PROTO); } invokeBeforeEnd(); } else if ((flags & TMSUCCESS) == TMSUCCESS) { // set to null if this is the current xid. // otherwise this could be an asynchronous success call if (equals(associatedXid, xid)) { invokeBeforeEnd(); } } else { throw new XAException(XAException.XAER_INVAL); } }
@Override public void end(Xid xid, int flags) throws XAException { LOG.debug("End: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } if ((flags & (TMSUSPEND | TMFAIL)) != 0) { // You can only suspend the associated xid. if (!equals(associatedXid, xid)) { throw new XAException(XAException.XAER_PROTO); } invokeBeforeEnd(); } else if ((flags & TMSUCCESS) == TMSUCCESS) { // set to null if this is the current xid. // otherwise this could be an asynchronous success call if (equals(associatedXid, xid)) { invokeBeforeEnd(); } } else { throw new XAException(XAException.XAER_INVAL); } }
@Override public void end(Xid xid, int flags) throws XAException { LOG.debug("End: {}, flags: {}", xid, XASupport.toString(flags)); if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO); } if ((flags & (TMSUSPEND | TMFAIL)) != 0) { // You can only suspend the associated xid. if (!equals(associatedXid, xid)) { throw new XAException(XAException.XAER_PROTO); } invokeBeforeEnd(); } else if ((flags & TMSUCCESS) == TMSUCCESS) { // set to null if this is the current xid. // otherwise this could be an asynchronous success call if (equals(associatedXid, xid)) { invokeBeforeEnd(); } } else { throw new XAException(XAException.XAER_INVAL); } }
if (isInLocalTransaction()) { throw new XAException(XAException.XAER_PROTO);