Package javax.sql

Examples of javax.sql.XAConnection.addConnectionEventListener()


    // when switching between global transactions and local
    // and setting connection state.
    // some of this is already tested in simpleDataSource and checkDataSource
    // but I want to make sure I cover all situations. (djd)
    xac = dsx.getXAConnection();
    xac.addConnectionEventListener(new EventCatcher(6));
    xar = xac.getXAResource();
    xid = new cdsXid(1, (byte) 93, (byte) 103);

    // series 1 - Single connection object
    Connection cs1 = xac.getConnection();
View Full Code Here


    checkLocks(cs1);
    cs1.commit();

    // attach the XA transaction to another connection and see what happens
    XAConnection xac2 = dsx.getXAConnection();
    xac2.addConnectionEventListener(new EventCatcher(5));
    XAResource xar2 = xac2.getXAResource();

    xar2.start(xid, XAResource.TMJOIN);
    Connection cs2 = xac2.getConnection();
View Full Code Here

    xac2.close();

    // allow close on already closed XAConnection
    xac2.close();
    xac2.addConnectionEventListener(null);
    xac2.removeConnectionEventListener(null);

    // test methods against a closed XAConnection and its resource
    try {
      xac2.getXAResource();
View Full Code Here

        // checks currently only implemented for embedded
        if (usingEmbedded())
        {
            SecurityCheck.assertSourceSecurity(xac, "javax.sql.XAConnection");
        }
        xac.addConnectionEventListener(new AssertEventCatcher(3));
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());

        pc = dsp.getPooledConnection();
        pc.addConnectionEventListener(new AssertEventCatcher(2));
View Full Code Here

        assertConnectionOK(
            expectedValues, "ConnectionPoolDataSource", pc.getConnection());

        // test "local" XAConnections
        xac = dsx.getXAConnection();
        xac.addConnectionEventListener(new AssertEventCatcher(4));
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());
        xac.close();
View Full Code Here

            expectedValues, "XADataSource", xac.getConnection());
        xac.close();

        // test "global" XAConnections
        xac = dsx.getXAConnection();
        xac.addConnectionEventListener(new AssertEventCatcher(5));
        XAResource xar = xac.getXAResource();
        // checks currently only implemented for embedded
        if (usingEmbedded())
        {
           SecurityCheck.assertSourceSecurity(
View Full Code Here

        // some of this may be tested elsewhere too.

        XADataSource dsx = J2EEDataSource.getXADataSource();
        JDBCDataSource.setBeanProperty(dsx, "DatabaseName", dbName);
        XAConnection xac = dsx.getXAConnection();
        xac.addConnectionEventListener(new AssertEventCatcher(6));
        XAResource xar = xac.getXAResource();
        Xid xid = new cdsXid(1, (byte) 93, (byte) 103);

        // series 1 - Single connection object
        Connection cs1 = xac.getConnection();
View Full Code Here

            ResultSet.HOLD_CURSORS_OVER_COMMIT};

        XADataSource dsx = J2EEDataSource.getXADataSource();
        JDBCDataSource.setBeanProperty(dsx, "DatabaseName", dbName);
        XAConnection xac = dsx.getXAConnection();
        xac.addConnectionEventListener(new AssertEventCatcher(6));
        XAResource xar = xac.getXAResource();
        Xid xid = new cdsXid(1, (byte) 103, (byte) 119);

        // now check re-use of *Statement objects across local/global
        // connections.
View Full Code Here

        assertLocks(new int[] {14,14}, cs1);
        cs1.commit();

        // attach the XA transaction to another connection and see what happens
        XAConnection xac2 = dsx.getXAConnection();
        xac2.addConnectionEventListener(new AssertEventCatcher(5));
        XAResource xar2 = xac2.getXAResource();

        xar2.start(xid, XAResource.TMJOIN);
        Connection cs2 = xac2.getConnection();
View Full Code Here

        xar2.end(xid, XAResource.TMSUCCESS);
        xac2.close();

        // allow close on already closed XAConnection
        xac2.close();
        xac2.addConnectionEventListener(null);
        xac2.removeConnectionEventListener(null);

        // test methods against a closed XAConnection and its resource
        try {
            xac2.getXAResource();
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.