Package javax.transaction.xa

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


        // verify there are no more global transactions
        assertGlobalXactCount(0);
       
        // Need to explicitly rollback xid2 as it ended with
        // an implicit rollback XA_RBTIMEOUT
        xar2.rollback(xid2);
       
        // Make sure both connections can be used to make a new global xact
        xar.start(xid, XAResource.TMNOFLAGS);
        s.executeUpdate("CREATE TABLE TABLT (I INT)");
        s.executeUpdate("INSERT INTO TABLT VALUES(1)");
View Full Code Here


           
            // with bug AMQ-4950 the thrown error reads "Cannot call prepare now"
            // we check that we receive the original exception message as
            // thrown by the BrokerPlugin
            assertEquals(simulatedExceptionMessage, xae.getMessage());
            resource.rollback(tid);
        }
        // couple of assertions
        assertTransactionGoneFromBroker(tid);
        assertTransactionGoneFromConnection(broker.getBrokerName(), xaConnection.getClientID(), xaConnection.getConnectionInfo().getConnectionId(), tid);
        assertTransactionGoneFromFailoverState(xaConnection, tid);
View Full Code Here

    {
        XAResource xaResource = getXAResource();
        int xaRetVal = XAResource.XA_OK;

        try {
            xaResource.rollback(xid);
            if (SanityManager.DEBUG)
            {
                connThread.trace("rollback  XA transaction: xaRetVal=" + xaRetVal);
            }
        } catch (XAException xe)
View Full Code Here

        XASession session = connection.createXASession();
        XAResource resource = session.getXAResource();

        Xid tid = createXid();
        try {
            resource.rollback(tid);
            fail("Expected xa exception on no tx");
        } catch (XAException expected) {
            LOG.info("got expected xa", expected);
            assertTrue("not zero", expected.errorCode != XAResource.XA_OK);
        }
View Full Code Here

                    rs.close();
                if (stm != null)
                    stm.close();

                // rollback the global transaction
                xaRes.rollback(xid);
                // close the connection
                xaConn.close();
            } catch (Exception e) {
                // ignore the exception because it
                // would hide the original exception
View Full Code Here

        // close all the stuff
        rs.close();
        stm.close();

        // rollback the global transaction
        xaRes.rollback(xid);

        // close the connection
        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

                          + XAeForget.getMessage()   + " errorCode: "
                          + XAeForget.errorCode  + "  calling forget on a prepared transaction",
                        XAException.XAER_PROTO, XAeForget.errorCode);
        } finally {
            s.close();
            xar.rollback(xid);
            conn.close();
            xaconn.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.