Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transactions
Message
From
27/04/2002 14:45:12
 
 
To
24/04/2002 10:03:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00648654
Message ID:
00650025
Views:
28
Not quite sure that this is what you're looking for:
I have found that despite what the help file says TXNLEVEL() is scoped to the DATASESSION somehow. If you BEGIN TRANSACTION in one DATASESSION, change datasessions and check TXNLEVEL(), it shows 0.


>Hello everybody!
>
>Is it true that VFP native transactions cannot be "spread over" multiple objects?
>
>For Example:
>
>Define Class A
>
>Procedure DoSomething()
>loObjA=CREATEOBJECT('DataObjectA')
>loObjB=CREATEOBJECT('DataObjectB')
>
>BEGIN TRANSACTION
>IF !loObjA.UpdateTableA()
>** Rollback if failed
> ROLLBACK
> RETURN .F.
>ENDIF
>
>loObjB.UpdateTableB()
>** same kind of IF-clause here
>END TRANSACTION
>ENDPROC
>
>ENDDEFINE
>
>this won't work... Tables are updated, but there is no "transactional" behavior.
>
>
>But if I replace those method calls in above class with local code (same things done right in class A), transactions will work.
>
>
>
>The tables that the objects DataObjA and DataobjB update, are opened in a form that calls this DoSomething() method in Class A. So they are not opened in objects themselves.
>
>I'm using VFP 5.0.
>
>Could this have something to do with datasessions?
>
>Any help appreciated!
>
>Thanks,
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform