Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BEGIN Transaction
Message
 
À
08/10/1999 09:42:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00274085
Message ID:
00274251
Vues:
37
BEGIN TRANSACTION

** Do whatever insert or ReadComm
IF Not Success
   ROLLBACK
   TABLEREVRT(.T.)
   ENDTRANSACTION
To see how to get the code formatted, replay to this and carefully look for the < pre > and < /pre > tags.

The point of the changes I made were that they removed all calls to outside routines from inside the transaction. With the code you posted there is no way to know what is screwing up the transaction because outside routines are being called and we have no idea what those routines are doing.

This recent code snippet has some basic flaws in it also,

1) ROLLBACK ends a transaction so the END TRANSACTION is redundant and will probably error because there should not be a transaction in process.

Another thing to consider is the triggers of the tables, do they start and end transactions? If they do are those transactions ended properly? What code ran before this code and after it, did that code start and not close a transaction?

The code fragment I sent you will work flawlessly, it will never leave a transaction open, the tablereverts wil work fine. That is as long as something else in your system isn't messing things up on you.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform