Package javax.transaction

Examples of javax.transaction.Transaction.rollback()


        if (currentTransaction == null)
            throw new IllegalStateException();

        timeouts.remove(currentThread);

        currentTransaction.rollback();

    }


    /**
 
View Full Code Here


        String logMessage = Messages.format
            (SlideTransactionManager.class.getName() + ".rollback",
             currentTransaction.toString());
        logger.log(logMessage, LOG_CHANNEL, Logger.INFO);

        currentTransaction.rollback();

    }


    /**
 
View Full Code Here

      {
         if (started != null)
         {
            try
            {
               started.rollback();
            }
            catch (Exception e)
            {
               JMSBridgeTest.log.error("Failed to rollback", e);
            }
View Full Code Here

            if (beanTransaction == null) {
                return;
            }

            try {
                beanTransaction.rollback();
            } catch (final Exception e) {
                logger.error("Error rolling back suspended transaction for discarded stateful session bean instance");
            }
        }
    }
View Full Code Here

    public void testTxOp() throws Exception {
        Transaction tx;
        tm.begin();
        tx = tm.getTransaction();
        tx.rollback();
        assertEquals(Status.STATUS_NO_TRANSACTION, tx.getStatus());
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());

        tm.begin();
        assertFalse(tx.equals(tm.getTransaction()));
View Full Code Here

        Transaction tx = getTransaction();
        if (tx == null) {
            throw new IllegalStateException("No transaction associated with current thread");
        }
        try {
            tx.rollback();
        } finally {
            unassociate();
        }
    }
View Full Code Here

        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();
        assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
        Transaction tx = tm.getTransaction();
        assertNotNull(tx);
        tx.rollback();
        assertNotNull(tm.getTransaction());
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());

        //check rollback when marked rollback only
        tm.begin();
View Full Code Here

        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();
        Transaction tx = tm.getTransaction();
        tx.enlistResource(r1_1);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.rollback();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertTrue(!r1_1.isCommitted());
        assertTrue(!r1_1.isPrepared());
        assertTrue(r1_1.isRolledback());
    }
View Full Code Here

        tx.enlistResource(r1_1);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.enlistResource(r1_2);
        tx.delistResource(r1_2, XAResource.TMSUCCESS);
        tx.setRollbackOnly();
        tx.rollback();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertTrue(!r1_1.isCommitted() & !r1_2.isCommitted());
        assertTrue(!r1_1.isPrepared() & !r1_2.isPrepared());
        assertTrue(r1_1.isRolledback() ^ r1_2.isRolledback());
    }
View Full Code Here

        Transaction tx = getTransaction();
        if (tx == null) {
            throw new IllegalStateException("No transaction associated with current thread");
        }
        try {
            tx.rollback();
        } finally {
            threadTx.set(null);
            ((TransactionImpl)tx).setCurrentThread(null);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.