Package javax.sql

Examples of javax.sql.XAConnection.addConnectionEventListener()


    XADataSource dsx = dscsx;
    checkToString(dsx);

    XAConnection xac = dsx.getXAConnection();
    xac.addConnectionEventListener(new EventCatcher(3));

    checkConnection("EmbeddedXADataSource", xac.getConnection());

    // BUG 4471 - check outstanding updates are rolled back wi XAConnection.
    c1 = xac.getConnection();
View Full Code Here


    checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
    checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());

    // test "local" XAConnections
    xac = dsx.getXAConnection();
    xac.addConnectionEventListener(new EventCatcher(4));
    checkConnection("EmbeddedXADataSource", xac.getConnection());
    checkConnection("EmbeddedXADataSource", xac.getConnection());
    xac.close();

    // test "global" XAConnections
View Full Code Here

    checkConnection("EmbeddedXADataSource", xac.getConnection());
    xac.close();

    // test "global" XAConnections
    xac = dsx.getXAConnection();
    xac.addConnectionEventListener(new EventCatcher(5));
    XAResource xar = xac.getXAResource();
    Xid xid = new cdsXid(1, (byte) 35, (byte) 47);
    xar.start(xid, XAResource.TMNOFLAGS);
    Connection xacc = xac.getConnection();
    xacc.close();
View Full Code Here

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

  public GenerationObject create(String _user, String _password)
    throws SQLException {
    GenerationObject genObject;
    XAConnection xaCon = xads.getXAConnection(_user, _password);
    // get the xa connection
    xaCon.addConnectionEventListener(this); // add it to the event listener
    log.debug(
      "StandardXAPoolDataSource:create create a object for the pool");
    genObject =
      new GenerationObject(xaCon, pool.getGeneration(), _user, _password);
View Full Code Here

        // some of this may be tested elsewhere too.

        XADataSource dsx = J2EEDataSource.getXADataSource();
        XAConnection xac = dsx.getXAConnection();
        AssertEventCatcher aes6 = new AssertEventCatcher(6);
        xac.addConnectionEventListener(aes6);
        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

        // handled correctly
        // Some more isolation testing using SQL and JDBC api
        XADataSource dsx = J2EEDataSource.getXADataSource();
        XAConnection xac = dsx.getXAConnection();
        AssertEventCatcher aes6 = new AssertEventCatcher(6);
        xac.addConnectionEventListener(aes6);
        XAResource xar = xac.getXAResource();
        Connection conn = xac.getConnection();
        Statement s = conn.createStatement();
        // initial local
        assertConnectionState(
View Full Code Here

            ResultSet.HOLD_CURSORS_OVER_COMMIT};

        XADataSource dsx = J2EEDataSource.getXADataSource();
        XAConnection xac = dsx.getXAConnection();
        AssertEventCatcher aes6 = new AssertEventCatcher(6);
        xac.addConnectionEventListener(aes6);
        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

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.