Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Leak / Session Object
Message
From
07/11/2003 06:10:40
 
 
To
06/11/2003 10:17:24
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00846763
Message ID:
00847548
Views:
22
Hi Bob,

>I'm I the only one that thinks this behavior isn't correct?

I think this is correct but :
- the documentation is incomplete;
- the empty object is incomplete.

Explain:

On VFP a datasession is a entity, and a suicide semaphore prevents its dead.

On VFP a object is a entity, and a suicide semaphore prevents its dead.

On VFP any root object live on a datasession, and increment datasession suicide semaphore.

When you do
SCATTER NAME oRec
1. VFP creates a Empty object, this live on current datasession and object variable increment suicide semaphore of the object ( this is a variable linked object );
2. then insert the fields like properties ( this is a implicit ADDITIVE clause )

In this situation VFP it operates correctly.

The problem is:
a variable linked Empty object have not properties and methods for explicit move it on another datasession.

If you put attention on two point 1. and 2., you found the solution.

The command :
SCATTER NAME oRec ADDITIVE
not change the datasession where oRec live.

Then the solution is ( only on VFP8 ):
CLEAR
PUBLIC oRec
SET DATASESSION TO 1
oRec     = CREATEOBJECT("Empty")     && this live on 1
oSession = CREATEOBJECT("session")
? ASESSIONS(ssList)
SET DATASESSION TO m.oSession.DataSessionId
CREATE CURSOR XX ( F1 I DEFAULT 7)
APPEND BLANK
SCATTER NAME oRec ADDITIVE  && this copy data only
RELEASE oSession
?? ASESSIONS(ssList)
? oRec.F1
If you want oRec live only on Datasession then :
CLEAR
oSession = CREATEOBJECT("session")
oSession.AddProperty("oRec")
? ASESSIONS(ssList)
SET DATASESSION TO m.oSession.DataSessionId
CREATE CURSOR XX ( F1 I DEFAULT 8)
APPEND BLANK
SCATTER NAME oSession.oRec
RELEASE oSession
?? ASESSIONS(ssList)
Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform