Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Networked, multiuser, transaction, tableupdate, buffer e
Message
De
22/07/1997 12:53:24
Ron Tse-Jung Huang
Leader Professional Consulting
Shin-Chu, Taiwan
 
 
À
22/07/1997 11:35:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00041098
Message ID:
00041141
Vues:
32
>-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

But what can I use to detect whether there is any failure? Normally how you do this?

>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.

OK, I see the point now. thanks!

Another question is about an example I have read, in which all operations on tables are done, followed by

operation 1
operation 2
...
...
...
Begin Transaction
select table1
lsuccess =tableupdate(.T.)
select table2
fsuccess=tableupdate(.T.)

if lsuccess=.F. or fsuccess=.f.
end transaction
else
rollback
endif

Some questions about this piece of code.
1. Does it mean that all real data writing(to disk) are made after issuing tableupdate, instead the operations before Begin transaction.
2. I assume it to be in table buffering mode. If I am right, should I put a
tablerevert before rollback?
3. should I issue tableupdate to each table respectively?

Many thanks.

Best regards,
Ron.


>-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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform