Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transactions
Message
De
24/04/2002 10:03:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Transactions
Divers
Thread ID:
00648654
Message ID:
00648654
Vues:
45
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,
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform