Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Leak / Session Object
Message
From
07/11/2003 08:41:32
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00846763
Message ID:
00847591
Views:
21
David, Here is a sample that I posted on a earlier thread. I failed to mention that most of my testing is done in a command line. If you use code stop after the set step command and look at the data session window.
oSession = CREATEOBJECT("session")
SET DATASESSION TO oSession.DataSessionId
USE ? && any table
SCATTER NAME oRec
SET DATASESSION TO 1
RELEASE oSession
set step on
?""
&& The data session created with the oSession object reference still exist
&& One would think this should go away when it is oSession is released. 
&& But the object reference created by the scatter name isn't allowing it 
&& to go away until it (oRec) is explicitly released or goes out of scope
&& to me the datasession should go away when the session object is released
&& regardless of the status of the object reference oRec.
If you to replace the scatter name with a scatter to:
&&SCATTER NAME oRec
SCATTER TO aRec
&& Now when releasing oSession the datasession goes away.  Different behavior
&& the Scatter Name commaand
The datasession won't get held up like it would if you to do a scatter name.

As far as scope goes, in my prior examples if the object that was created by Scatter name goes out of scope the datasesssion that was held up does go away. However in some of my testing when I create two session objects and do a scatter name to the same object reference in both datasession then release both session object one of the datasession will get held up and won't go away at all, even when explictly release the scatter reference. The problem here is I haven't been able to consistantly reproduce this behavior.

Anymore insight would be appreciated. Thanks for your help David.

BW
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform