DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33591>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33591





------- Additional Comments From [EMAIL PROTECTED]  2005-02-15 18:49 -------
You want to invalidate the pooled connection if the underlying connection is
closed. Try the following PoolableConnection.close() method.

     public synchronized void close() throws SQLException {
        try {
            if (_conn.isClosed()) {
                // underlying connection closed behind our back
                try {
                    _pool.invalidateObject(this);
                } catch (Exception ie) {
                    // DO NOTHING
                }
                throw new SQLException("Cannot close connection (underlying
connection already closed)");
            }
        } catch (SQLException e) {
            try {
                _pool.invalidateObject(this);
            } catch (Exception ie) {
                // DO NOTHING the original exception will be rethrown
            }
            throw new SQLNestedException("Cannot close connection (isClosed
check failed)", e);
        }
        if (_closed) {
            throw new SQLException("Already closed.");
        } else {
            try {
                _pool.returnObject(this);
            } catch(SQLException e) {
                throw e;
            } catch(RuntimeException e) {
                throw e;
            } catch(Exception e) {
                throw new SQLNestedException("Cannot close connection (return to
pool failed)", e);
            }
        }
    }


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to