Examples of delistResource()


Examples of javax.transaction.Transaction.delistResource()

         tm.begin();
        
         Transaction tx = tm.getTransaction();
         tx.enlistResource(res);
        
         tx.delistResource(res, XAResource.TMSUCCESS);
        
         //Then we do a commit
         tm.commit();
                             
         //Then we receive the messages outside the tx
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

         tm.begin();
        
         tx = tm.getTransaction();
         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);
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

        
         tm.begin();
        
         Transaction tx = tm.getTransaction();
         tx.enlistResource(res);
         tx.delistResource(res, XAResource.TMSUCCESS);
        
         //Then we do a rollback
         tm.rollback();                
        
         //Then we receive the messages outside the global tx
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

        
         tx = tm.getTransaction();
        
         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);
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

               if (TxUtils.isUncommitted(tx))
               {
                  TransactionSynchronizer synchronizer = TransactionSynchronizer.getRegisteredSynchronizer(tx);
                  if (synchronization.enlisted)
                     synchronizer.removeEnlisted(synchronization);
                  if (tx.delistResource(getXAResource(), XAResource.TMSUSPEND) == false)
                     throw new ResourceException("Failure to delist resource: " + this);
               }
            }
         }
         catch (Throwable t)
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

    public void testOneResourceOnePhaseCommit() throws Exception {
        Xid externalXid = xidFactory.createXid();
        Transaction tx = tm.importXid(externalXid, 0);
        tx.enlistResource(r1_1);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tm.commit(tx, true);
        assertEquals(Status.STATUS_NO_TRANSACTION, tx.getStatus());
    }

    public void testOneResourceTwoPhaseCommit() throws Exception {
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

    public void testOneResourceTwoPhaseCommit() throws Exception {
        Xid externalXid = xidFactory.createXid();
        Transaction tx = tm.importXid(externalXid, 0);
        tx.enlistResource(r1_1);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        assertEquals(XAResource.XA_OK, tm.prepare(tx));
        assertTrue(!r1_1.isCommitted());
        assertTrue(r1_1.isPrepared());
        assertTrue(!r1_1.isRolledback());
        tm.commit(tx, false);
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

        Transaction tx = tm.importXid(externalXid, 0);
        tx.enlistResource(r1_1);
        tx.enlistResource(r1_2);
        tx.enlistResource(r2_1);
        tx.enlistResource(r2_2);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.delistResource(r1_2, XAResource.TMSUCCESS);
        tx.delistResource(r2_1, XAResource.TMSUCCESS);
        tx.delistResource(r2_2, XAResource.TMSUCCESS);
        assertEquals(XAResource.XA_OK, tm.prepare(tx));
        assertTrue(!r1_1.isCommitted() & !r1_2.isCommitted());
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

        tx.enlistResource(r1_1);
        tx.enlistResource(r1_2);
        tx.enlistResource(r2_1);
        tx.enlistResource(r2_2);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.delistResource(r1_2, XAResource.TMSUCCESS);
        tx.delistResource(r2_1, XAResource.TMSUCCESS);
        tx.delistResource(r2_2, XAResource.TMSUCCESS);
        assertEquals(XAResource.XA_OK, tm.prepare(tx));
        assertTrue(!r1_1.isCommitted() & !r1_2.isCommitted());
        assertTrue(r1_1.isPrepared() ^ r1_2.isPrepared());
View Full Code Here

Examples of javax.transaction.Transaction.delistResource()

        tx.enlistResource(r1_2);
        tx.enlistResource(r2_1);
        tx.enlistResource(r2_2);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.delistResource(r1_2, XAResource.TMSUCCESS);
        tx.delistResource(r2_1, XAResource.TMSUCCESS);
        tx.delistResource(r2_2, XAResource.TMSUCCESS);
        assertEquals(XAResource.XA_OK, tm.prepare(tx));
        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
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.