Package javax.sql

Examples of javax.sql.PooledConnection.removeConnectionEventListener()


    if (o == null)
      return;
    try {
      PooledConnection pooledCon = (PooledConnection) o;
      pooledCon.close(); // call close() of PooledConnection
      pooledCon.removeConnectionEventListener(this);
      log.debug("StandardPoolDataSource:expire close the connection");
    } catch (java.sql.SQLException e) {
      log.error(
        "StandardPoolDataSource:expire Error java.sql.SQLException in StandardPoolDataSource:expire");
    }
View Full Code Here


                        Connection con = null;

                        try
                        {
                            //we don't want any callbacks while we're clearing warnings
                            pc.removeConnectionEventListener( cl );

                            con = pc.getConnection();
                            SQLWarnings.logAndClearWarnings(con);
                        }
                        finally
View Full Code Here

                    Connection conn = null;
                    Throwable rootCause = null;
                    try 
                    {
                        //we don't want any callbacks while we're testing the resource
                        pc.removeConnectionEventListener( cl );

                        conn = pc.getConnection(); //checkout proxy connection

                        // if this is a c3p0 pooled-connection, let's get underneath the
                        // proxy wrapper, and test the physical connection sometimes.
View Full Code Here

                        Connection con = null;

                        try
                        {
                            //we don't want any callbacks while we're clearing warnings
                            pc.removeConnectionEventListener( cl );

                            con = pc.getConnection();
                            SQLWarnings.logAndClearWarnings(con);
                        }
                        finally
View Full Code Here

                    Connection conn = null;
                    Throwable rootCause = null;
                    try 
                    {
                        //we don't want any callbacks while we're testing the resource
                        pc.removeConnectionEventListener( cl );

                        conn = pc.getConnection(); //checkout proxy connection

                        // if this is a c3p0 pooled-connection, let's get underneath the
                        // proxy wrapper, and test the physical connection sometimes.
View Full Code Here

             */
            public void connectionClosed(ConnectionEvent event) {
                PooledConnection pce = (PooledConnection) event.getSource();
                assertSame(pc, pce);
                count1[0]++;
                pce.removeConnectionEventListener(this);
            }

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

        xaConnection.addConnectionEventListener(new ConnectionEventListener() {

            @Override
            public void connectionClosed(ConnectionEvent event) {
                PooledConnection pc = (PooledConnection) event.getSource();
                pc.removeConnectionEventListener(this);
                try {
                    pc.close();
                } catch (SQLException e) {
                    System.err.println("Failed to close XAConnection");
                    e.printStackTrace();
View Full Code Here

     */
    @Override
    public void destroyObject(UserPassKey key, PooledObject<PooledConnectionAndInfo> p)
            throws Exception {
        PooledConnection pc = p.getObject().getPooledConnection();
        pc.removeConnectionEventListener(this);
        pcMap.remove(pc);
        pc.close();
    }

    /**
 
View Full Code Here

            try {
                _pool.returnObject(pci.getUserPassKey(), pci);
            } catch (Exception e) {
                System.err.println("CLOSING DOWN CONNECTION AS IT COULD " +
                "NOT BE RETURNED TO THE POOL");
                pc.removeConnectionEventListener(this);
                try {
                    _pool.invalidateObject(pci.getUserPassKey(), pci);
                } catch (Exception e3) {
                    System.err.println("EXCEPTION WHILE DESTROYING OBJECT " +
                            pci);
View Full Code Here

        if (null != event.getSQLException()) {
            System.err
                .println("CLOSING DOWN CONNECTION DUE TO INTERNAL ERROR (" +
                         event.getSQLException() + ")");
        }
        pc.removeConnectionEventListener(this);

        PooledConnectionAndInfo info = pcMap.get(pc);
        if (info == null) {
            throw new IllegalStateException(NO_KEY_MESSAGE);
        }
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.