Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Maintaining data session state
Message
 
À
21/09/2002 19:23:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00703118
Message ID:
00703122
Vues:
12
Michel,

I don't know if this is really what you're looking for, but if you create a private session in the Init method of a class and switch to it in the Init, all methods in the object automatically execute in the specified datasession.

If you need to have methods execute in another datasession than the object was created in, you have to pass a parameter to the method and switch to the according session that was passed as a parameter inside the method.

I haven't tried what happens, when you make a subclass and you're switching the datasession before the DODEFAULT(). Maybe the parent class method keeps the session. So maybe subclassing and switching the datasession inside the subclass may help. But as I said ... not really sure about this.

HTH,
Armin

>>Object methods are always executed in the datasession object was created under.
>
>On a very special requirement, after a multiple series of objects being created (WWC framework), I am creating some data sessions of my own that specific transactions should be bound to. However, as soon as we call WWC Response.ExpandTemplate(), as it was created before, at the top of the framework, it resets my current datasession to that previous state.
>
>I really need to find a workaround for that. Assuming my datasession is set to 2, I need to rely on the fact that calling any method from any objects that was created at first could recognize the current data session.

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform