Consultor Eletrônico



Kbase P95553: JDBC Application does not detect disconnection from DB and crashes.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/03/2009
Status: Verified

SYMPTOM(s):

JDBC Application does not detect disconnection from DB and crashes.

[JDBC Progress Driver]:-20217 General error

Java.SQL isClosed() method is used to detect the DB disconnection.

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

CAUSE:

According to the Java documentation from Sun, the isClosed() method is guaranteed to have the value true, just when a Connection.close() method is invoked.
This method generally cannot be called to determine whether a connection to a database is valid or invalid.
A disconnection from the DB may or may not set the isClosed() method to true.

FIX:

To determine that a connection is invalid do the following:
1) Perform a SQL operation on the DB.
2) Catch any exceptions that might be thrown.