PRB: COM .Dll In MTS 'Sharing' Datasessions Between Instances (193953)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q193953 SYMPTOMS
Moving the record pointer of a table in one object instance of a Component
Object Model (COM) .dll file created in Visual FoxPro, moves the record
pointer in all instances of that object when running in Microsoft
Transaction Server (MTS).
CAUSE
Using a table outside the data environment causes the cursor to be public
to all instances of that object.
RESOLUTION
Open and access the table that uses a cursor object in a data environment
with the DataSession property set to two (2) Private.
In the example provided in the Steps To Reproduce Behavior section, change
the SERVER CODE to the following.
NOTE: After rebuilding the COM .dll, make sure to delete the Component
object from the MTS Package, then add it back using the Add Component/Add
New Component menu options.
***************Server Code With Dataenvironment******************
DEFINE CLASS MTSData AS FORM OLEPUBLIC
DATAENVIRONMENT=.NULL.
DATASESSION=2 &&PRIVATE
PROCEDURE LOAD
SET DEFAULT TO "c:\MTSTest"
THIS.DATAENVIRONMENT=CREATEOBJECT("MTSDataEnv")
ENDPROC
PROCEDURE movenext
SKIP 1
ENDPROC
PROCEDURE moveprev
SKIP -1
ENDPROC
PROCEDURE movefirst
GO TOP
ENDPROC
PROCEDURE movelast
GO BOTTOM
ENDPROC
PROCEDURE returnrec
LPARAMETER MyArray
EXTERNAL ARRAY MyArray
MyArray(1,1)=fld1
MyArray(2,1)=fld2
MyArray(3,1)=fld3
ENDPROC
ENDDEFINE
DEFINE CLASS MTSDataEnv AS DATAENVIRONMENT
ADD OBJECT cursor1 AS MTScursor
PROCEDURE INIT
THIS.OPENTABLES
ENDPROC
ENDDEFINE
DEFINE CLASS MTScursor AS CURSOR
PROCEDURE INIT
OPEN DATABASE MTSData SHARED
THIS.EXCLUSIVE=.F.
THIS.ALIAS="MTSTest"
THIS.DATABASE="c:\MTSTest\MTSData.dbc"
THIS.CURSORSOURCE="MTSTest"
ENDPROC
ENDDEFINE
****************End Server Code With Dataenvironment**************
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 8/6/1999 |
---|
Keywords: | kbprb KB193953 |
---|
|