Board index » delphi » Re: Can I nest transactions?

Re: Can I nest transactions?


2006-03-21 02:49:30 AM
delphi147
Bryce K. Nielsen writes:
Quote
The question has come up if another modal form is displayed, can a
2nd transaction be started and rollback nested within the first?
1) No, but (with recent versions of IB) you can use a savepoint, which
is pretty similar.
2) Be careful about transaction lifetime. If you start a read/write,
snapshot transaction and the user goes on vacation you can easily kill
the server. With older versions of IB *any* long-running transaction
can kill the server.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio González has a new CD of
Irish music out, and it is good: tinyurl.com/7hgfr
 
 

Re: Can I nest transactions?

Bryce K. Nielsen writes:
Quote
The current paradigm for a client/server app I am working on starts a
transaction, shows a Data-Entry form modally, and if the user clicks
OK, saves and commits the transaction. If they click Cancel, then
rollsback the transaction (it's handy for a form with a master/child.
All master and child data is inserted but if they cancel, just rolled
back). The question has come up if another modal form is displayed,
can a 2nd transaction be started and rollback nested within the first?

-BKN
You can start multiple transactions on the same connection at the same
time but they are not nested. For example, if you start transaction A
then start transaction B then commit A transaction B is still active. B
is not nested within A and, therefore, is not committed when A is
committed. If you want the effect of a nested transaction use a
savepoint.
--
Bill Todd (TeamB)
 

Re: Can I nest transactions?

The current paradigm for a client/server app I am working on starts a
transaction, shows a Data-Entry form modally, and if the user clicks OK,
saves and commits the transaction. If they click Cancel, then rollsback the
transaction (it's handy for a form with a master/child. All master and child
data is inserted but if they cancel, just rolled back). The question has
come up if another modal form is displayed, can a 2nd transaction be started
and rollback nested within the first?
-BKN