commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36077] New: - stmt.getConnection() != Connection used to create the statement
Date Mon, 08 Aug 2005 11:38:25 GMT
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=36077>.
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=36077

           Summary: stmt.getConnection() != Connection used to create the
                    statement
           Product: Commons
           Version: 1.2 Final
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: alexander.rupsch@gmx.de


Hi,

I'm not an expert in implementing connection pools or jdbc itself. But shouldn't
the following code work?

Connection con = pool.getConnection()
PreparedStatement ps = con.prepareStatement()

con.equals(ps.getConnection) // returns false!

Ok, I don't need it to be equal, but the following also does not work:

ps.getConnection().close()
con.isClosed() // is false!!!

That means, if I have a Statment and want to close its connection, I have to
remember the conncetion. Is that the requested behavior? Because of this my pool
is running over.

The java.sql API says that Statment.getConnection() has to be the connection
which created the statement.

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


Mime
View raw message