Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding public object and Data Session
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01319198
Message ID:
01319212
Vues:
20
>>>Good morning,
>>>
>>>Say you have an object (based on CUSTOM class) declared PUBLIC but instantiated in a form with Private Data Session. Does it mean that the methods of this object will be always be using Private Data Session? That is, tables open or cursors created in a method of this object are not available outside of the object/method?
>>
>>Here is the catch - when you create an object, unless it's a session based class it always shares the DS of the calling process.
>>
>>I do remember I was hit by this pretty badly once and only with Dragan's help was able to figure out the root of my problems.
>
>So you are saying that if the base of the class was SESSION I wouldn't have to worry about calling methods of this class/object from any procedure (even private DS form)?
>
>UPDATE. Even after changing the base class from CUSTOM to SESSION, the methods of the class seem to be working in private DS.

Sorry, I really have to run now. If the class is based on session, then everything is happening inside its own private session.

If the class is based on something else (custom, for example), it shares the DS of the calling object. If it's a form, it shares its DS. If you instantiated your class in the main program, it would be working in the Global (Default) DS.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform