Subject | Re: [IBO] Nested Transactions? |
---|---|
Author | ehandbury |
Post date | 2002-05-23T04:35:26Z |
--- In IBObjects@y..., "Helen Borrie (TeamIBO)" <helebor@t...> wrote:
changes using BigTrans before the LittleForm invocation and would
expect that all changes (including those in LittleForm) would be part
of the overall transaction.
The only way I could think of is to dynamically create a new
TIB_Transaction upon each LittleForm invocation. When the user
commits BigTrans, the program would go thru' the dynamically
allocated transactions and commit all of them then, and then delete
them. To the user, all changes are part of the main transaction, and
they have the ability to rollback out of each LittleForm invocation,
but its a pain-in-the-*** for me to do it.
IS there any problems with this approach?
Thanks. Eric.
> > 2) If the user saves the changes in the inner form, then thethis
> >changes in LittleTrans become part of the changes in BigTrans. This
> >is because each invocation of the inner form will result in a
> >separate transaction instance. For example, the user may invoke
> >inner form 5 times during the lifetime of the BigTrans, and mayonly
> >want to save the changes from 3 of these invocations.solution
> >
> > Is #2 possible?
>
> Nope. InterBase doesn't support nested transactions. The only
> available to make the whole "Big Thing" rollback-able is not tocommit what
> you call the "inner transactions" but to keep everything within thesame
> transaction.place
>
> IBO helps you, though. Look at the TIB_TransactionSource - you can
> this on your child form and, in the OnCreate, hook it up to thetransaction
> on the main form. Start a new transaction before you create thechild form
> (or before the door opens for the child form activity to begin).On the
> child form, provide some sort of a Go/Cancel mechanism for the userin case
> s/he changes her mind. Don't do a row-by-row commit on the childform
> : just post the work from the child form and let the main formtake care
> of committing or rolling it back.Thanks, Helen, but this doesn't help. The user may have made
changes using BigTrans before the LittleForm invocation and would
expect that all changes (including those in LittleForm) would be part
of the overall transaction.
The only way I could think of is to dynamically create a new
TIB_Transaction upon each LittleForm invocation. When the user
commits BigTrans, the program would go thru' the dynamically
allocated transactions and commit all of them then, and then delete
them. To the user, all changes are part of the main transaction, and
they have the ability to rollback out of each LittleForm invocation,
but its a pain-in-the-*** for me to do it.
IS there any problems with this approach?
Thanks. Eric.