Examples of addConnectionEventListener()


Examples of javax.sql.PooledConnection.addConnectionEventListener()

            logger.warning("StatementPooling not " +
                     "implemented for external (non-c3p0) " +
                     "ConnectionPoolDataSources.");
              }
            }
        out.addConnectionEventListener( cl );
        return out;
          }
      catch (Exception e)
          {
        if (logger.isLoggable( MLevel.WARNING ))
View Full Code Here

Examples of javax.sql.PooledConnection.addConnectionEventListener()

        rootCause = e;
          }
      finally
          {
        ConnectionUtils.attemptClose( conn ); //invalidate proxy connection
        pc.addConnectionEventListener( cl )//should we move this to CONNECTION_IS_OKAY case? (it should work either way)
          }
     
      switch (status)
          {
          case ConnectionTester.CONNECTION_IS_OKAY:
View Full Code Here

Examples of javax.sql.PooledConnection.addConnectionEventListener()

    this.closeEventCount = 0;

    try {
      pc = this.cpds.getPooledConnection();

      pc.addConnectionEventListener(conListener);

      Connection _conn = pc.getConnection();

      Connection connFromStatement = _conn.createStatement()
          .getConnection();
View Full Code Here

Examples of javax.sql.PooledConnection.addConnectionEventListener()

    final int NB_TESTS = 5;

    try {
      pc = this.cpds.getPooledConnection();

      pc.addConnectionEventListener(conListener);

      for (int i = 0; i < NB_TESTS; i++) {
        Connection _conn = pc.getConnection();

        try {
View Full Code Here

Examples of javax.sql.XAConnection.addConnectionEventListener()

        }

        int traceId = ((JdbcXAConnection) xaConn).getTraceId();
        assertTrue(xaConn.toString().startsWith("xads" + traceId + ": conn"));

        xaConn.addConnectionEventListener(new ConnectionEventListener() {
            public void connectionClosed(ConnectionEvent event) {
                // nothing to do
            }

            public void connectionErrorOccurred(ConnectionEvent event) {
View Full Code Here

Examples of javax.sql.XAConnection.addConnectionEventListener()

        if (usingEmbedded())
        {
            SecurityCheck.assertSourceSecurity(xac, "javax.sql.XAConnection");
        }
        AssertEventCatcher aes3 = new AssertEventCatcher(3);
        xac.addConnectionEventListener(aes3);
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());
        //Check if got connection closed event but not connection error event
        assertTrue(aes3.didConnectionClosedEventHappen());
        assertFalse(aes3.didConnectionErrorEventHappen());
View Full Code Here

Examples of javax.sql.XAConnection.addConnectionEventListener()

        aes2.resetState();

        // test "local" XAConnections
        xac = dsx.getXAConnection();
        AssertEventCatcher aes4 = new AssertEventCatcher(4);
        xac.addConnectionEventListener(aes4);
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());
        //Check if got connection closed event but not connection error event
        assertTrue(aes4.didConnectionClosedEventHappen());
        assertFalse(aes4.didConnectionErrorEventHappen());
View Full Code Here

Examples of javax.sql.XAConnection.addConnectionEventListener()

        xac.close();

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

Examples of javax.sql.XAConnection.addConnectionEventListener()

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

Examples of javax.sql.XAConnection.addConnectionEventListener()

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