/** * Send TransactionInfo to indicate transaction has started * * @throws JMSException if some internal error occurs */ protected void doStartTransaction() throws JMSException { if (getTransacted() && !transactionContext.isInXATransaction()) { transactionContext.begin(); } }
/** * Send TransactionInfo to indicate transaction has started * * @throws JMSException if some internal error occurs */ protected void doStartTransaction() throws JMSException { if (getTransacted() && !transactionContext.isInXATransaction()) { transactionContext.begin(); } }
/** * Send TransactionInfo to indicate transaction has started * * @throws JMSException if some internal error occurs */ protected void doStartTransaction() throws JMSException { if (getTransacted() && !transactionContext.isInXATransaction()) { transactionContext.begin(); } }
/** * Send TransactionInfo to indicate transaction has started * * @throws JMSException if some internal error occurs */ protected void doStartTransaction() throws JMSException { if (getTransacted() && !transactionContext.isInXATransaction()) { transactionContext.begin(); } }
/** * Send TransactionInfo to indicate transaction has started * * @throws JMSException if some internal error occurs */ protected void doStartTransaction() throws JMSException { if (getTransacted() && !transactionContext.isInXATransaction()) { transactionContext.begin(); } }
@Test public void testSyncIndexCleared() throws Exception { final AtomicInteger beforeEndCountA = new AtomicInteger(0); final AtomicInteger rollbackCountA = new AtomicInteger(0); Synchronization sync = new Synchronization() { @Override public void beforeEnd() throws Exception { beforeEndCountA.getAndIncrement(); } @Override public void afterCommit() throws Exception { fail("expected rollback exception"); } @Override public void afterRollback() throws Exception { rollbackCountA.incrementAndGet(); } }; underTest.begin(); underTest.addSynchronization(sync); underTest.rollback(); assertEquals("beforeEnd", 1, beforeEndCountA.get()); assertEquals("rollback", 1, rollbackCountA.get()); // do it again underTest.begin(); underTest.addSynchronization(sync); underTest.rollback(); assertEquals("beforeEnd", 2, beforeEndCountA.get()); assertEquals("rollback", 2, rollbackCountA.get()); }