commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Sack <>
Subject Re: stmt.getConnection() != Connection used to create the statement
Date Mon, 22 Aug 2005 11:53:03 GMT
Alexander Rupsch wrote:
> I can go around this problem very easy by using the "remember the con by
> myself" workaround, but I was wondering about the current
> implementation. You can see this behavior in dbcp and in dbpool (can't
> find the link right now) and this makes me wonder....

Yes, you have to do it. I can't tell about a specific standardization
document, but I think it's a best practice of pool implementors to rely
on users to close connections explicitly. The reason is that you can use
connections from pools for more than one statement, thus, you have to
close it in order to allow the pool to determine if that connection can
be reused.

What is your problem with remembering the reference to the connection?

> I also could take a look in the statement pooling feature and don't even
> use a connection., but this wouldn't clarify the problem.

Sorry, I don't get what you mean here .... ?

Alexander Sack      +49 (40) 692 13 - 179     e-mail:
Contelligent ... CMS for j2ee & devels -
C:1 Financial Services GmbH  -  Dorotheenstr. 64   -   22301 Hamburg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message