Package javax.sql

Examples of javax.sql.PooledConnection.removeConnectionEventListener()


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

        PooledConnectionAndInfo info = (PooledConnectionAndInfo) pcMap.get(pc);
        if (info == null) {
            throw new IllegalStateException(NO_KEY_MESSAGE);
        }
View Full Code Here


     * Closes the PooledConnection and stops listening for events from it.
     */
    public void destroyObject(Object obj) throws Exception {
        if (obj instanceof PooledConnectionAndInfo) {
            PooledConnection pc = ((PooledConnectionAndInfo)obj).getPooledConnection();
            pc.removeConnectionEventListener(this);
            pcMap.remove(pc);
            pc.close();
        }
    }

View Full Code Here

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

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

        Object info = pcMap.get(pc);
        if (info == null) {
            throw new IllegalStateException(NO_KEY_MESSAGE);
        }
View Full Code Here

        {
            System.err
                .println("CLOSING DOWN CONNECTION DUE TO INTERNAL ERROR");
            //remove this from the listener list because we are no more
            //interested in errors since we are about to close this connection
            pc.removeConnectionEventListener(this);
        }
        catch (Exception ignore)
        {
            // ignore
        }
View Full Code Here

        {
            System.err
                .println("CLOSING DOWN CONNECTION DUE TO INTERNAL ERROR");
            //remove this from the listener list because we are no more
            //interested in errors since we are about to close this connection
            pc.removeConnectionEventListener(this);
        }
        catch (Exception ignore)
        {
            // ignore
        }
View Full Code Here

            // clean used connections
            ListIterator usedIterator = usedPool.listIterator();
            while (usedIterator.hasNext()) {
                PooledConnection con = (PooledConnection) usedIterator.next();
                // stop listening for connection events
                con.removeConnectionEventListener(this);
                // close connection
                con.close();
                // remove connection from the list
                usedIterator.remove();
            }
View Full Code Here

                    .println("CLOSING DOWN CONNECTION DUE TO INTERNAL ERROR (" +
                             event.getSQLException() + ")");
            }
            //remove this from the listener list because we are no more
            //interested in errors since we are about to close this connection
            pc.removeConnectionEventListener(this);
        } catch (Exception ignore) {
            // ignore
        }

        PooledConnectionAndInfo info = (PooledConnectionAndInfo) pcMap.get(pc);
View Full Code Here

                        "CLOSING DOWN CONNECTION DUE TO INTERNAL ERROR ("
                        + event.getSQLException() + ")");
            }
            //remove this from the listener list because we are no more
            //interested in errors since we are about to close this connection
            pc.removeConnectionEventListener(this);
        } catch (Exception ignore) {
            // ignore
        }

        Object info = pcMap.get(pc);
View Full Code Here

            // clean used connections
            ListIterator usedIterator = usedPool.listIterator();
            while (usedIterator.hasNext()) {
                PooledConnection con = (PooledConnection) usedIterator.next();
                // stop listening for connection events
                con.removeConnectionEventListener(this);
                // close connection
                con.close();
                // remove connection from the list
                usedIterator.remove();
            }
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.