Add check for closed connections in DbConnection.isValid()

This commit is contained in:
hns 2009-11-30 14:47:56 +00:00
parent 0227e1bce6
commit dece309fce

View file

@ -40,11 +40,11 @@ public class DbConnection {
}
public boolean isValid(int id) {
if (id != serialId) {
return false;
}
// test if connection is still ok
try {
if (id != serialId || connection.isClosed()) {
return false;
}
Statement stmt = connection.createStatement();
stmt.execute("SELECT 1");
stmt.close();