Package javax.transaction.xa

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


         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#rollback(TransactionResource)
         */
        public void rollback(TransactionResource resource) throws DavException {
            XAResource xaRes = getXAResource(resource);
            try {
                xaRes.rollback(xid);
                removeLocalTxReferences(resource);
            } catch (XAException e) {
                throw new DavException(DavServletResponse.SC_FORBIDDEN, e.getMessage());
            }
        }
View Full Code Here


            Xid xid = recoveredStart[i];
            if (xid.getFormatId() == 1) {
                // commit 1 with 2pc
                xar.commit(xid, false);
            } else if (xid.getFormatId() == 2) {
                xar.rollback(xid);
            } else {
                fail("FAIL: unknown xact");
            }
        }
View Full Code Here

        } catch (XAException e) {
            if (e.errorCode != XAException.XAER_NOTA)
                throw e;
        }
        try {
            xar.rollback(xid11);
        } catch (XAException e) {
            if (e.errorCode != XAException.XAER_NOTA)
                throw e;
        }
        try {
View Full Code Here

         * attached to a -- local transaction. xa_commit xa_2phase 1; xa_end
         * xa_success 2; xa_rollback 2;
         */
        xar.commit(xid, false);
        xar.end(xid2, XAResource.TMSUCCESS);
        xar.rollback(xid2);

        XATestUtil.checkXATransactionView(conn, null);
        rs = s.executeQuery("select * from APP.fooMorph where A >= 2000");
        expectedRows = new String[][] { { "2001" }, { "2002" }, { "2003" },
                { "2005" }, { "2007" } };
View Full Code Here

            xar.end(xid3, XAResource.TMFAIL);
        } catch (XAException e) {
            if (e.errorCode != XAException.XA_RBROLLBACK)
                throw e;
        }
        xar.rollback(xid3);

        conn = xac.getConnection();
        s = conn.createStatement();
        rs = s.executeQuery("select * from APP.fooMorph where A >= 2000");
        expectedRows = new String[][] { { "2001" }, { "2002" }, { "2003" },
View Full Code Here

            /* Try to close the prepared statement. This would throw an exception
             * before the fix, claiming that the table was not found. */
            ps.close();
        } finally {
            /* Rollback the transaction and close the connections */
            xar.rollback(xid);
            conn.close();
            xaconn.close();
        }
       
    }
View Full Code Here

            /* Try to close the prepared statement. This would throw an exception
             * before the fix, claiming that the table was not found. */
            cs.close();
        } finally {
            /* Rollback the transaction and close the connections */
            xar.rollback(xid);
            conn.close();
            xaconn.close();
        }
       
    }
View Full Code Here

        // network client)
        xar.start(xid, XAResource.TMRESUME);

        // End the transaction and free up the resources
        xar.end(xid, XAResource.TMSUCCESS);
        xar.rollback(xid);
        xac.close();
    }

    /**
     * DERBY-4232: Test that two branches can be joined after the timeout has
View Full Code Here

        // Do some work on the new branch before joining (the bug won't be
        // reproduced if we join with a fresh branch)
        Xid xid2 = XATestUtil.getXid(4, 5, 7);
        xar2.start(xid2, XAResource.TMNOFLAGS);
        xar2.end(xid2, XAResource.TMSUCCESS);
        xar2.rollback(xid2);

        assertTrue(
                "Branches can only be joined if RM is same",
                xar1.isSameRM(xar2));
View Full Code Here

        // network client.
        xar2.start(xid1, XAResource.TMJOIN);

        // End the transaction and free up the resources
        xar2.end(xid1, XAResource.TMSUCCESS);
        xar2.rollback(xid1);
        xac1.close();
        xac2.close();
    }

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