Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession and Queries ran from an object???/
Message
From
10/06/2014 11:47:15
 
 
To
10/06/2014 10:31:10
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01601560
Message ID:
01601574
Views:
58
You could try this:
(be sure to read the help on DataSessionID Property)
define class myBO as session

procedure firstForm.Load()
this.addProperty('myBO', createObject('myBO'))
this.myBO.dataSessionID = this.dataSessionID

procedure someEvent
do form anotherForm with thisForm.myBO

procedure anotherForm.Init()
lparameters myBO
m.myBO.addProperty('dataSessionIDold', m.myBO.dataSessionID)
m.myBO.dataSessionID = this.dataSessionID
this.addProperty('myBO', m.myBO)

procedure anotherForm.Destroy()
this.myBO.dataSessionID = this.myBO.dataSessionIDold
>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??
>
>
>.
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Reply
Map
View

Click here to load this message in the networking platform