Subject Connection.isClosed()
Author Ian A. Newby
Hi Folks,
I have a hashmap of connections, which may contain duplicate
connections. The connections are obtained from a FBWrappingDatasource.

I'm trying to commit and close the connections in a loop. Obviously, I
don't want to commit and close the same connection twice.

My code to do this is as follows:

for (Connection con : connections.values()) {
if (!con.isClosed()) {

However, on the if (!con.isClosed()) { line I get the following error...

org.firebirdsql.jdbc.FBSQLException: Connection
org.firebirdsql.pool.PooledConnectionHandler@94a28e was closed. See
the attached exception to find the place where it was closed
$Proxy12.isClosed(Unknown Source)

Should a check whether a connection is closed throw an exception if it is?

Ian Newby