Examples of enlistResource()


Examples of javax.transaction.Transaction.enlistResource()

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

Examples of javax.transaction.Transaction.enlistResource()

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

Examples of javax.transaction.Transaction.enlistResource()

         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

Examples of javax.transaction.Transaction.enlistResource()

         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

Examples of javax.transaction.Transaction.enlistResource()

         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

Examples of javax.transaction.Transaction.enlistResource()

         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

Examples of javax.transaction.Transaction.enlistResource()

        
         //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

Examples of javax.transaction.Transaction.enlistResource()

         try
         {
            complete = true;
            TransactionManager tm = getTransactionManager();
            Transaction tx = tm.getTransaction();
            tx.enlistResource(this);
         }
         catch (Exception e)
         {
            this.e = e;
         }
View Full Code Here

Examples of javax.transaction.Transaction.enlistResource()

        // This is the first use of the connection in this transaction, so we must
        // enlist it in the transaction
        Transaction transaction = getTransaction();
        try {
            XAResource xaResource = transactionRegistry.getXAResource(sharedConnection);
            transaction.enlistResource(xaResource);
        } catch (RollbackException e) {
            // transaction was rolled back... proceed as if there never was a transaction
        } catch (SystemException e) {
            throw (SQLException) new SQLException("Unable to enlist connection the transaction").initCause(e);
        }
View Full Code Here

Examples of javax.transaction.Transaction.enlistResource()

      TransactionManagerImpl tm = TransactionManagerImpl.getLocal();

      Transaction xa = tm.getTransaction();

      if (xa != null && xaResource != null)
        xa.enlistResource(xaResource);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new EJBException(e);
    }
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.