Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSession and Queries ran from an object???/
Message
De
10/06/2014 11:07:02
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/06/2014 10:31:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01601560
Message ID:
01601567
Vues:
45
>Here's what I'm finding...
>
>Any object in FoxPro that runs a query, whether against native DBFs or Sql Server, will create the cursor in the DataSession which was active at the time the object was created.
>
>The means that if you have a BO created in Form A with a Private DataSession, and you pass that object to Form B which has its own Private DataSession, if you use the object to run a query from Form B, the cursor will be created in the DataSession from Form A.
>
>Crazy! But true. It took be about an hour of stepping through the codez to figure this out.
>
>Does anyone know a work around, or a pattern to avoid this??

It has always been so, but you have to go deep in building your framework to notice :).

So tricks to avoid the regular behavior are many, the most popular being
- pass your result as xml to the other DS
- pass your .dataSessionID to the object's code, and switch to it while the query executes
- make sure your object is not too heavy and entangled with the rest of them, and instantiate it in your local DS.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform