Package javax.transaction

Examples of javax.transaction.Transaction.enlistResource()


        // Enlist XAResource if we are actually in a transaction
        if (tx != null) {
            if (mc.getOpenCount() == 1) { // Only if first/only thread
                try {
                    this.logger.debug("enlist XAResource on {0}", tx);
                    tx.enlistResource(mc.getXAResource());
                    ret.setAutoCommit(false);
                } catch (RollbackException e) {
                    // Although tx has been marked to be rolled back,
                    // XAResource has been correctly enlisted.
                    this.logger.warn("XAResource enlisted, but tx is marked rollback", e);
View Full Code Here


           
            tm.begin();
                    
            Transaction tx = tm.getTransaction();
           
            tx.enlistResource(res);
           
            tx.enlistResource(dummy);
           
            assertEquals(1, rm.size());
           
View Full Code Here

                    
            Transaction tx = tm.getTransaction();
           
            tx.enlistResource(res);
           
            tx.enlistResource(dummy);
           
            assertEquals(1, rm.size());
           
            tx.delistResource(res, XAResource.TMSUCCESS);
           
View Full Code Here

         {           
            tm.begin();
                    
            Transaction tx = tm.getTransaction();
           
            tx.enlistResource(res);
           
            tx.enlistResource(dummy);
           
            assertEquals(1, rm.size());
           
View Full Code Here

                    
            Transaction tx = tm.getTransaction();
           
            tx.enlistResource(res);
           
            tx.enlistResource(dummy);
           
            assertEquals(1, rm.size());
           
            tx.delistResource(res, XAResource.TMSUCCESS);
           
View Full Code Here

         XAResource res = xaSession.getXAResource();
        
         tm.begin();
        
         Transaction tx = tm.getTransaction();
         tx.enlistResource(res);
        
         //This should cause the work done previously to be converted into work done in the xa transaction
         //this is what an MDB does
         //There is a difficulty in transactional delivery with an MDB.
         //The message is received from the destination and then sent to the mdb container so
View Full Code Here

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

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

         XAResource res = xaSession.getXAResource();
        
         tm.begin();
        
         Transaction tx = tm.getTransaction();
         tx.enlistResource(res);
         tx.delistResource(res, XAResource.TMSUCCESS);
        
         //Then we do a rollback
         tm.rollback();                
        
View Full Code Here

        
         //And enlist again - the work should then be converted into the global tx branch
        
         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();
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.