Subject Master/Detail - Interbase
Author Dimitar Selensky
Hello all,

This is a very old question. In many of my forms I have tables linked in
master/detail relation ship. When someone creates a new master record and
several detail records, if the user cancels the master records, the detail
records will fall in the eternity...

One way is to use cached updates. But with cached updates I can't have a
query, doing a sum over some of the values (the sum is pretty complicated
and needs to have a group by clause, as for example it might sum prices in
different currencies).

Another way is to use transactions. When I start inserting or updating
detail rows, I start a transaction and it's being commited if the master is
saved and rollback-ed if it's canceled. It works perfectly, but:

1. The transaction life could be *very* long.
2. If there's another master/detail form of the same type opened at the same
time, there's a problem, as there's only one transaction (using tDatabase).

Is there another way of doing it? Somebody out there must have figured a
nicer way. I haven't found a way to have nested transactions in Interbase.
Is it possible?