Phil,

On 4/14/21 16:39, Phil Steitz wrote:

On 4/14/21 12:59 PM, Gary Gregory wrote:
Hi,

That's a tough sell IMO because (1) the JDBC specification does not require
this behavior AND (2) it would break existing applications. What is the
harm is having nothing happen when you close a closed connection?

That was the thinking when we changed this to the current behavior back in 1.3.  See https://issues.apache.org/jira/browse/DBCP-233

Thanks for the archeology on this one, Phil. I see that this has been considered in the past and it was determined that JDBC-spec-compliance made the most sense. I certainly see the logic in that.

What am I missing?

Gary, I'm trying to write the cleanest code I can, and if a tool like DBCP2 can help me fix my sloppy resource-management, all the better.

Would there be scope in making this an optional check, similar to the "log abandoned" features that are opt-in?

I always get my Connection objects from the same method in my own code, so I could wrap them in a proxy which keeps track of its closed-ness, but I figured this could be useful to a wider audience.

Thanks,
-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to