Subject | difficult procedure rollback |
---|---|
Author | Olaf Kluge |
Post date | 2011-05-19T17:48:30Z |
Hello,
A Procedure do the following:
For select . all positions in one order bundle (simplified, in real, one
transaction-id can be more orders and each some orderpositions)
Position should updadet
Check if position not started
Check other details
Okay, update
Next Position should deleted
Check if position not started
Check other details
Okay, delete old position and insert new
Next position should inserted
Check other details
Okay, insert
Next position should deleted
Check if position not started
Oh, Position starts
Now, all items of this "transactions-id" (one master-order with some
order-heads and each some positions) should be rollback! I could in case of
insert set a field with the current transactions-id and by an error delete
the positions. But, in case of already deleted or updated records?
An exception rollback all changes. In psql I cannot make a checkpoint, but
how can I solve the problem? Is there a statement for rollback?
If not, so I must check all conditions first (each order and orderpos. of
feasibility and after this, all again with real execution?
Thank you.
Best regards.
Olaf
[Non-text portions of this message have been removed]
A Procedure do the following:
For select . all positions in one order bundle (simplified, in real, one
transaction-id can be more orders and each some orderpositions)
Position should updadet
Check if position not started
Check other details
Okay, update
Next Position should deleted
Check if position not started
Check other details
Okay, delete old position and insert new
Next position should inserted
Check other details
Okay, insert
Next position should deleted
Check if position not started
Oh, Position starts
Now, all items of this "transactions-id" (one master-order with some
order-heads and each some positions) should be rollback! I could in case of
insert set a field with the current transactions-id and by an error delete
the positions. But, in case of already deleted or updated records?
An exception rollback all changes. In psql I cannot make a checkpoint, but
how can I solve the problem? Is there a statement for rollback?
If not, so I must check all conditions first (each order and orderpos. of
feasibility and after this, all again with real execution?
Thank you.
Best regards.
Olaf
[Non-text portions of this message have been removed]