Board index » delphi » Transactions or Cached updates?

Transactions or Cached updates?

I am confused about wether or not It is necessary to begin and commit
transactions.  If I use cached updates I still have the opportunity to
"undo" changes with cancel updates.

My reason for not wanting to use begin and commit transactions is that I
have several forms open at one time, possibly all with pending transactions.
If I use commit transactions, all will be commited. By using cached updates
one forms records at a time can be saved.

Any ideas would be appreciated.

Thanks

 

Re:Transactions or Cached updates?


Annette Gallagher <Galag...@WI.net> wrote in article
<6om69v$r2...@news.inc.net>...

Quote
> I am confused about wether or not It is necessary to begin and commit
> transactions.  If I use cached updates I still have the opportunity to
> "undo" changes with cancel updates.

> My reason for not wanting to use begin and commit transactions is that I
> have several forms open at one time, possibly all with pending
transactions.
> If I use commit transactions, all will be commited. By using cached
updates
> one forms records at a time can be saved.

> Any ideas would be appreciated.

> Thanks

If you do simple updates, use cached updates. However, there are several
cases where cached updates won't help, like when you update several records
in one statement, change a value in a column in cascaded referential
integrity, when triggers update some other records/tables....

Another thing: transactions are local to the connection, so if you need
multiple transactions, use multiple TDatabase objects.
Some servers support sub-transactions (savepoints), so you can use them
instead of multiple transactions - naturally depends on transaction type.

You'll also have to consider record locking and transaction isolation
level....
--
-------------------------
Regards,
Robert

Remove both qwe when replying.
MailTo: robert.qwece...@eunet.qwe.si

Other Threads