>
>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.
Begin..End transaction doesn't free you from writing tableupdate() if buffering is used or data won't be updated. Think begin..end transaction as interactively executing a series of commands. If you rollback at a point it means you didn't executed any of these (if supported by transaction). With or without transaction you would write tableupdates as necessary (end transaction doesn't make tableupdate). If you don't tableupdate or revert at a point it means like you quit or close the table without committing by update or revert. In case of issuing a rollback you don't need a tablerevert because you didn't do something to revert (rollback rolls you to the beginning)
One last thing, with transcation it doesn't differ if buffering is on or not and you can use a series of nested transactions (up to 5 currently).
Cetin