Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Networked, multiuser, transaction, tableupdate, buffer e
Message
De
22/07/1997 11:35:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/07/1997 08:54:39
Ron Tse-Jung Huang
Leader Professional Consulting
Shin-Chu, Taiwan
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00041098
Message ID:
00041123
Vues:
39
>Are these valid operations? And How can I know whether the commit operations
>are performed successfully? Does EndTransaction commit all changes made above?
>Or should I issue Begin and End transaction for each respectively?
>
>Another question is about buffer mode. Does begin transaction open buffers for each
>table automatically? Or should I issue a setcursorpro statement for each table respectively,
>or set form's buffer mode properties?
>
>What is the difference between tableupdate, end transaction, and tablerevert, rollback?
>When to use these pairs?
>
>I really need more detailed explaination about all of these, and thanks in advance to any information
>that could help me clarify these things.

-All of them are valid. But begin transaction ... end transaction is generally used with rollback also.
Begin transaction
.......
if anyfailure
rollback
else
end transaction
endif
With or without buffering begin.. end trans. gives you a way of controlling ALL or NONE operations are done. Think of a cheque payment, the server is somewhere 80 miles away and you're connected online. You control it, it's payable, you press "payed" and it must be balanced but a thunder doesn't let it. In the order of execution cheque may be marked as payed but the original balance lefts as it was before. In beg. end trans. all updates are done or none is done so you can recover it. Server, workstation failure or exiting VFP causes an implicit rollback.
-Table buffering is limited to tables not all dbfs in a session. In the case of above example, with just table buffering, you would update some of the tables and if they were remote tables you wouldn't have a way to revert them. Begin trans. ...rollback "rolls" the film back. Unlike table buffering your operations are buffered and a table need not be in buffer mode.
-There some command and functions not supported during a transaction and only tables in a database can be contained as a part of transaction. You can use free tables but they won't be restored in case off rollback.
-Network users don't have access to records contained in a transaction, So transaction should be short enough.
-OK when to use which. It varies by app. so there isn't a specific choice as I know. Generally I use Opt.table-row buffering and transaction together. If it's critical for me that none of the updates must be done in case of one fails I use transaction in data update routine. It is in one place generally so the records are not available to others for under one second. Putting begin transaction in a forms init and end transaction in exit code would need the mercy of the user unless it is really needed to be that way.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform