Subject Re: [IBO] How to retain iboControl values after rollback?
Author Michael Fung <ibo@cmsweb.com>
Luc,

Let me use an example.

1. client call query.post to insert a record to table A
2. after insert trigger (AI) of table A fire up,
3. AI insert a record to table B,
4. then AI also insert a record to table C, but that failed and an
exception is raised
5. the exception propagate to my client side application

If I do not rollback, changes to table A and B will not be undone if
I commit later. Am I right? Or, IBO will automatically rollback upon
exception?


Thanks.
Michael



--- In IBObjects@yahoogroups.com, Lucas Franzen <luc@r...> wrote:
>
>
> Michael,
>
> "Michael Fung " schrieb:
> >
> > Thanks Luc,
> >
> > Though I am just inserting to one table, the triggers in that
table
> > will update other tables. In that case, should I use rollback?
>
> The triggers will only fire when you write that record to the
database,
> so if you CANCEL a record it won't be posted to the database, thus
no
> trigger's firing at all.
>
> You have to distingish between client actions (as for example
setting a
> TIB_Query to INSERT oder EDIT mode) and server actions (which will
just
> take place when the client tries to post the record (i.e. issue the
> insert / update statement to the server)).
>
> So you can still COMMIT the transaction after cancelling your
> Insert/Edit mode. The triggers will not fire in either case.
>
> Regards
> Luc.