Connection.isClosed() is new in 1.6 and Connection.close() is a no-op if the connection is already closed, so let's go for brevity here and save people from having to have 1.6-specific JDBC drivers.

This commit is contained in:
Par Winzell
2009-09-04 19:06:25 +00:00
parent 82d742ec09
commit 3032a1e568
@@ -560,9 +560,7 @@ public class PersistenceContext
// close all opened statements; if any close fails, abort the close process as // close all opened statements; if any close fails, abort the close process as
// the whole connection is now unusable and will be discarded // the whole connection is now unusable and will be discarded
for (Statement stmt : stmts) { for (Statement stmt : stmts) {
if (!stmt.isClosed()) { stmt.close();
stmt.close();
}
} }
} }
// if auto-commit is off and this is a write operation, push it through // if auto-commit is off and this is a write operation, push it through