Kbase P141997: DISCONNECT statement does not actually disconnect from the database
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/5/2009 |
|
Status: Unverified
SYMPTOM(s):
DISCONNECT statement does not actually disconnect from the database
Application makes use of classes which contain static properties and methods
Other methods in the classes have references to database tables
** Warning -- database <name> is already connected. (1012)
Database physical names <name> and <name> do not match. No connect. (1018)
FACT(s) (Environment):
OpenEdge 10.1C
OpenEdge 10.2A
All Supported Operating Systems
CAUSE:
The OpenEdge Development: Object-oriented Programming manual states that once a static property or method of a class is accessed the class is loaded into memory and stays there for the rest of the session. Given this, if the class has references to tables in the database you are trying to disconnect then disconnect statement will pend until such time as there are no more references to tables in the database. Given that static classes hang around for the entire session once they are referenced for the first time it is not possible to get the disconnect statement to complete its task while the static classes have hard coded references to the database.
FIX:
Modify the code to use dynamic database objects and ensure that each method creates the needed buffers, uses them then deletes them before exiting from the method. Doing this will allow the disconnect statement to work as desired.