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 2006/03/23 02:40:29 UTC

DO NOT REPLY [Bug 39069] New: - PoolGuardConnectionWrapper violates close() contract

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=39069>.
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=39069

           Summary: PoolGuardConnectionWrapper violates close() contract
           Product: Commons
           Version: unspecified
          Platform: All
               URL: http://svn.apache.org/repos/asf/jakarta/commons/proper/d
                    bcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSo
                    urce.java
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dpark@gelaed.com


org.apache.commons.dbcp.PoolingDatasource.PoolGuardConnectionWrapper.close()
violates the Connection.close() contract specified in the Java 1.5 API.  The
current API specifies that calling close() on an already-closed connection is a
no-op.  (Blame Sun for the bug.  The API didn't used to say that.)  

PoolGuardConnectionWrapper.close() first calls checkOpen() which throws an
exception if close() has already been called.  Clearly that's not a no-op.

The simplest fix is to change the first line in the close() method from this:
checkOpen();

to this:
if (this.delegate == null) return;


As of today (2006-03-22) this bug is in the latest SVN source (and has been in
previous versions as well).


DelegatingConnection and PoolingConnection don't seem (from a quick glance) to
have this problem.

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


DO NOT REPLY [Bug 39069] - [dbcp] PoolGuardConnectionWrapper violates close() contract

Posted by bu...@apache.org.
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=39069>.
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=39069


sandymac@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|PoolGuardConnectionWrapper  |[dbcp]
                   |violates close() contract   |PoolGuardConnectionWrapper
                   |                            |violates close() contract




------- Additional Comments From sandymac@apache.org  2006-03-23 03:15 -------
This has come up before and a few weeks ago I found a number of close methods
that needed to be changed. See:
http://mail-archives.apache.org/mod_mbox/jakarta-commons-dev/200603.mbox/%3c6bde122b0603072304h20460a9ewc7d7e1eaa70f440@mail.gmail.com%3e

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