Subject Re: [IBO] weird posting error
Author Helen Borrie
At 02:58 AM 16/09/2003 +0000, you wrote:
>i have encoutered this problem twice. I have this table "produce"
>which have after insert trigger. What the trigger does is to update
>the record on table "items". The problem is that after saving the
>records and I use savepoint like
>this "produce.ib_transaction.savepoint" to commit the work.

savepoint doesn't commit anything. It just marks a point in the
transaction to which it will be possible to roll back, without rolling back
the whole transaction.

>After
>closing and re opening the table "produce" all the recently entered
>record where gone, but if I take a look at the table "items" I see
>that their is a change that take place, meaning the trigger on the
>table "produce" after insert where trigger but the record where not
>save.
>
>What happen here? I didn't use cache update here, what else should I
>check for?
>
>Although this happen very rare. But is it very annoying, because this
>is a inventory application where it must be very accurate.


I suggest that you either study the 1.5 releasenotes to find out how
savepoints actually work (and provide client-side handling code
accordingly) or avoid using savepoints. They are not useful in an
interactive task like this, where you need to be certain that everything
the user does is either committed in total or rolled back in total.

The safe approach is to post the user's changes, letting the triggers take
their course, and then either handle exceptions or commit.

Helen