commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (DBCP-329) SQLException: Already closed.
Date Tue, 30 Mar 2010 11:10:27 GMT


Phil Steitz commented on DBCP-329:

Honestly, I am ambivalent on this.  I can see the argument on both sides.  The use case reported
here is another good example of one in which the client would prefer silent disposal - close
in a finally block after the badness has been encountered on use.  On the other hand, I can
see situations where the client really would like to know about these events.

What do you think, Paul?  Other opinions?

> SQLException: Already closed.
> -----------------------------
>                 Key: DBCP-329
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: MySQL
>            Reporter: Hontvari Jozsef
> After upgrading to 1.4 I see such exceptions logged:
> java.sql.SQLException: Already closed.
> 	at org.apache.commons.dbcp.PoolableConnection.close(
> 	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(
> 	...
> This should never happen. According to the Connection.close() javadoc: 
> "Calling the method close on a Connection object that is already closed is a no-op."
> Moreover, I am pretty sure that our code does not close the connection twice. But because
the close() is called in a finally block, it is possible that this exception hides another
exception. Unfortunately I cannot reproduce it, even though it occurs regularly.

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

View raw message