Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple instances of VFP .DLL - all share open tables?
Message
From
22/06/1998 10:33:50
Alastair Cameron
Farpoint Software Development Limited
Edinburgh, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Multiple instances of VFP .DLL - all share open tables?
Miscellaneous
Thread ID:
00110547
Message ID:
00110547
Views:
64
Hi.

I only recently realised that multiple instances of a VFP 5 ActiveX automation server that you build as a DLL (and for all I know,.EXE) share the same data environment (i.e. open tables, databases).

However, each instance has their own separate copies of global data (such as class properties) which I thought they would.

Specifically, say you have a VFP automation server compiled as a DLL, and it contains several methods, one of which is called OPENTABLES (which has several OPEN DATABASE / USE commands).

If from inside of VFP (or from other COM controller such as Active Server Pages) you do:

x = create("myvfpserver.class)
x.opentables

and then do:

y = create("myvfpserver.class)

method code running in the y instance of the server has access to .DBF
tables opened in the x instance, even if you have not called the
y.opentables method yet.

I didn't check if the record pointers in those tables were separate or shared, although presumably because private data sessions are NOT being used, if the record pointer is moved in one instance, the next time subsequent instances of the server access the table, the record pointer will be on the *SAME* record.

However, class properties are completely separate in each instance.

What implications does this have is you attempt in one instance of the server to CLOSE ALL / CLOSE TABLES - will this pull down the other instances of the server the next time access it attempted to a table that was previously open?

I appreciate that with Forms/Private Data Sessions you can get around this type of problem, buy my VFP server does not use forms/private data sessions!

Is this by design, and without using Forms is there anything you can do about this? It will not cause me a problem (I don't think) but I was still surprised that this was the case...I'd have figured that each instance was *COMPLETEY* self-contained.

Thanks.

Alastair Cameron
alastair.cameron@cableinet.co.uk
Next
Reply
Map
View

Click here to load this message in the networking platform