Package javax.transaction

Examples of javax.transaction.Transaction.rollback()


      {
         public void run()
         {
            try
            {
               t.rollback();
            }
            catch (Exception e)
            {
               exceptions.add(e);
            }
View Full Code Here


                    if (transactionStatus != STATUS_COMMITTED) {
                        String errMsg = "Transaction started by the bean but not committed.";
                        // Log error
                        logger.error(errMsg);
                        // Rollback
                        transactionAfter.rollback();
                        //TODO: discard
                        // Throw Exception
                        throw new EJBException(errMsg);
                    }
                }
View Full Code Here

         //prior to when the xasession is enlisted in the tx, into work done in the xa tx
        
         tx.delistResource(res, XAResource.TMSUCCESS);
        
         //Now rollback the tx - this should cause redelivery of the two messages
         tx.rollback();
        
         rm1 = (TextMessage)cons.receive(1000);
        
         assertNotNull(rm1);
        
View Full Code Here

         tx.enlistResource(res);
        
         tx.delistResource(res, XAResource.TMSUCCESS);        
              
         //Now rollback the tx - this should cause redelivery of the two messages
         tx.rollback();
        
         rm1 = (TextMessage)cons.receive(1000);
        
         assertNotNull(rm1);
        
View Full Code Here

         tx.enlistResource(res);
        
         tx.delistResource(res, XAResource.TMSUCCESS);
              
         //Now rollback the tx - this should cause redelivery of the two messages
         tx.rollback();
        
         rm1 = (TextMessage)cons.receive(1000);
        
         assertNotNull(rm1);
        
View Full Code Here

            try
            {
               synchronized (transaction)
               {
                  if (TxUtils.isActive(tx))
                     tx.rollback();
               }
            }
            catch (Exception ignored)
            {
            }
View Full Code Here

            try
            {
               synchronized (transaction)
               {
                  if (TxUtils.isActive(tx))
                     tx.rollback();
               }
            }
            catch (Exception ignored)
            {
            }
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

        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

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.