Skip to Content
0
Former Member
Jan 17, 2018 at 05:14 PM

Autoinstantiate, destroy not working

251 Views

Hi guys.

I have a regular NVO (call it NVO1) that has an autoinstantiate NVO (lets call it NVO2) as an instance object. This autoinstante nvo opens a connection to the DB on its constructor, and calls a disconnect on its destructor.

// Sample:
NVO1 >> instance variables: NVO2 iuo_2
NVO2.constructor: connect;
NVO2.desctructor: disconnect;

My code:
NVO1 luo_1
// At this moment, I have only 1 connection open to the DB

luo_1 = Create NVO1
// Now I have 2 connections open, because of the autoinstantiate of it's instance nvo. All good.

Destroy luo_1
// Here's the thing, it didn't disconnect. The connection remais open.
// Only when I close the application the connections are closed. Even calling GarbageCollect does not help.
// This sample code is used in a loop, so I'm reaching "maximum number of connections" on the DB server rather quickly. I'm on PB12.5.

Any thoughts on this? The changes to rebuild NVO2 will be substantial. :(