commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DBCP-11) [dbcp] stmt.getConnection() != Connection used to create the statement
Date Mon, 12 Mar 2007 23:46:09 GMT

    [ https://issues.apache.org/jira/browse/DBCP-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480224
] 

Henri Yandell commented on DBCP-11:
-----------------------------------

My vote (with a few minutes thought) is that the Statements should be returning the Connection
they came from and not the underlying physical connection. ie) We should change things.

> [dbcp] stmt.getConnection() != Connection used to create the statement
> ----------------------------------------------------------------------
>
>                 Key: DBCP-11
>                 URL: https://issues.apache.org/jira/browse/DBCP-11
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: Operating System: other
> Platform: All
>            Reporter: Alexander Rupsch
>             Fix For: 1.3
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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