You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/02/15 18:44:55 UTC

DO NOT REPLY [Bug 33591] New: - [DBCP] Connection leak in PoolableConnection.close() (Oracle 10g driver)

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

           Summary: [DBCP] Connection leak in PoolableConnection.close()
                    (Oracle 10g driver)
           Product: Commons
           Version: 1.2 Final
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dirk.verbeeck@pandora.be


Mail from Hugh Winkler on commons-dev (15-2-2005)
--------------------------------------------------
PoolableConnection.close() does logic equivalent to :

  if ( isClosed()){
      throw new SQLException(.);
  } else {
      _pool.returnObject(this);
  }

The isClosed() method is that of ancestor DelegatingConnection, and it does:
  if(_closed || _conn.isClosed()) {
      return true;
  }
  return false;


Now nothing prevents the underlying connection from closing itself; that's
why isClosed() checks _conn.isClosed() -- "did you close yourself while I
wasn't looking?" But in that case PoolableConnection never calls
_pool.returnObject(). 

I've got a query in Oracle 10g that causes Oracle's connection to close
itself: the famous "end of file on connection" message causes the connection
to enter the closed state. Doesn't take long to exhaust the pool.

I think the logic we want in PoolableConnection.close() is like so:



  if ( _closed ){ // really ask, did *we* close the connection already
      throw new SQLException(.);
  } else {
      _pool.returnObject(this);
  }

If I've got some logic wrong please stop me before I deploy that change
here!

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org