Subject | Re: [IBO] Another Simple question |
---|---|
Author | lester@lsces.co.uk |
Post date | 2002-02-05T15:17:36Z |
> I need to start a new transaction every iteration of the loop, as there areThat would be nice, but it can't happen.
> other posts taking place. I want either all or none to be committed.
I have a similar problem, I want to process an order - with
several line items - and be able to roll back a line if it
can't be completed, or roll back the whole order if there
are too many problems.
I use a transaction for each line, but then if I want to
abandon an order later I have to manually undo the previous
lines one by one.
In your case, add a flag for 'ADDING', commit each line (
slower but safe ), and then you can process each record in a
transaction. If you decide to abandon the add, DELETE WHERE
ADDING = 'X', otherwise just update ADDING ready for the
next import.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services