Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transactions and Table Buffering
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00093954
Message ID:
00094365
Vues:
23
>Peter,
>
>No you have the idea of transaction wrong. A transaction is used to group a number of table actions into a single all or none operation. Generally when used with buffering all of the inserting and replacing will have all taken place before the transaction starts. The transaction would be soething like this;
>
> BEGIN TRANSACTION
> llRollBack = .F.
> IF NOT TableUpdate(0,.f.,"Table1")
>    llRollBack = .T.
> ELSE
>   IF NOT TableUpdate(0,.f.,"Table2")
>      llRollback = .F.
>   ELSE
>      IF NOT TableUpdate(0, .F., "Table3)
>         llRollBack = .T.
>      ENDIF
>   ENDIF
> ENDIF
> IF llRollBack
>    ROLLBACK
> ELSE
>    ENDTRANSACTION
> ENDIF
>
After mulling over the problem for awhile, I decided my use of buffering was inappropriate. I was using table buffering to store error messages until after the transaction and then submitting them. Unfortunatelly, Fox decided to rollback the message even in the Table Buffer, so now I'm using just a plain old array to buffer the error messages until after the rollback/end transaction block. Other options are of course available, such as create cursor, but the array is nice because you don't have to worry about data types, etc.

Thanks for you help,
Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform