Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Leak / Session Object
Message
From
07/11/2003 13:29:15
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00846763
Message ID:
00847741
Views:
22
David,
>>Well, the big difference in the above code is aRec is not an object, it's >>an array. An array doesn't have the same mechanism of object references >>that the SCATTER NAME object uses.

I understand it is an array but it was still created with a Scatter command and one could expect the underlying behavior to remain the same when the session object is release, regardless if it were scatter to an array or an object.

>>Do you understand that the session must exist throughout the lifetime of >>the object created inside it? Because these objects can be more complex >>than your simple SCATTER NAME object. and they probably want to commit >>changes back to their datasource at some point.

I understand this now but in light of the behavior of the scatter to an array it make less sense to me why it behaves this way. I mean the array may still need to be committed to the datasource, right? In VFP releasing a datasession behaves one way if you use the 'scatter to' and another way if you use 'scatter name'. Another thing, why does Fabio's solution produce the behavior that I would expect? It uses scatter name oEmptyObjectReference additive, does one simple clause in the scatter command make that much of a difference?

A datasession that is opened when you create a session object will go away when you release the session object Eeeeeeceeeeept when..... Where is this behavior documented? I can't find it, did I miss something somewhere? This makes a lot less sense to me now. It's like playing a game and you think sombody is changing the rules in the middle of the game when infact the rules are being told.

>>Can I ask the bigger scope issue about why this is a problem for you? What >>are you trying to do?

I'm maintaing somebody elses code and to be honest, I have no idea the the goals, responsiblities or intent of this code. But what I do know is when we run the code that is written there is a pretty big memory leak. When I step into the code and start commenting out code that doesn't cause the leak, the last thing that happens when the leak surfaces is a SCATTER NAME command. When I take this line of code out the memory leak goes away. Which lead to my testing of the session object, datasessions and scoping of reference varible and scatter objects.

>>What is the use case for wanting the same object to contain data from >>different data sessions?

To share data across datasessions

David, Thanks for you help and insight

BW
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform