Package javax.transaction.xa

Examples of javax.transaction.xa.XAResource.rollback()


          exception = true;
            throw new TransactionRuntimeException(e);           
        } finally {
            try {
                if (!delistSuccessful || test.rollbackAllways()|| test.exceptionOccurred()) {
                  xaResource.rollback(xid);
                }
                else if (commit) {
                  xaResource.commit(xid, true);
                }           
            } catch (Exception e) {
View Full Code Here


        xa.start(xid, XAResource.TMJOIN);
        PreparedStatement ps = connection.prepareStatement("UPDATE TEST SET VAL=? WHERE ID=?");
        ps.setInt(1, new Random().nextInt());
        ps.setInt(2, 1);
        ps.close();
        xa.rollback(xid);
        connection.close();
        c.close();
        deleteDb("xa");
    }
View Full Code Here

        assertTrue(c.getAutoCommit());

        res.start(xid, XAResource.TMNOFLAGS);
        assertTrue(!c.getAutoCommit());
        res.end(xid, XAResource.TMFAIL);
        res.rollback(xid);
        assertTrue(c.getAutoCommit());

        c.close();
        xa.close();
    }
View Full Code Here

         assertEquals(xid1, xids[0]);
        
         log.trace("rolling back the tx");
        
         //rollback
         res3.rollback(xids[0]);
        
         log.trace("rolledb back the tx");
        
         Thread.sleep(1000);
        
View Full Code Here

         assertEquals(xid1, xids[0]);
        
         log.trace("rolling back the tx");
        
         //rollback
         res3.rollback(xids[0]);
        
         log.trace("rolled back the tx");
        
         Thread.sleep(1000);
View Full Code Here

            if (xidsToRecover == null || xidsToRecover.contains(xid))
            {
               try
               {
                  log.info("rollbacking of Xid " + xid);
                  xares.rollback(txInDoubt[k]);
               }
               catch (Exception e)
               {
                  log.error("Error in rollback of Xid " + txInDoubt[k], e);
               }
View Full Code Here

         // Prepare the transaction
         resource.end(xid1, XAResource.TMSUCCESS);
         resource.prepare(xid1);
        
         // Rollback
         resource.rollback(xid1);

         xid1 = new MyXid();
         resource.start(xid1, XAResource.TMNOFLAGS);
         // Receive the message using "AutoAcknowledge"
         message = subscriber.receiveNoWait();
View Full Code Here

                        {
                            resourceManager.commit(xid, true);
                        }
                        else
                        {
                            resourceManager.rollback(xid);
                        }
                    }
                    catch (Throwable e)
                    {
                        if( failures == null )
View Full Code Here

                    {
                        Object key = branchKeys.next();
                        XAResource resourceManager = (XAResource) branches.get(key);
                        try
                        {
                            resourceManager.rollback((Xid) key);
                        }
                        catch (Throwable e)
                        {
                            JPOXLogger.TRANSACTION.error(LOCALISER.msg("015038", "rollback", resourceManager, getXAErrorCode(e), toString()));                       
                            if( failures == null )
View Full Code Here

            {
                Xid xid = (Xid) branchKeys.next();
                XAResource resourceManager = (XAResource) branches.get(xid);
                try
                {
                    resourceManager.rollback(xid);
                }
                catch (Throwable e)
                {
                    if( failures == 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.