[Info-ingres] Database procedure for loops and commit/rollback
Roy Hann
specially at processed.almost.meat
Fri Jun 7 09:51:51 UTC 2019
Martin Bowes wrote:
> Is putting a commit or rollback in the processing of a for loop
> a good idea or not?
Being able to do it is probably a good thing from a commercial point of
view; give the punters what they want.
Personally I'd contort myself into eye-popping shapes to avoid ever
doing it.
Committing (or rolling back) doesn't just "persist" your changes, it
also surrenders read consistency. You can no longer have confidence that
you are updating the database as it currently is. You will no longer be
protected by serialization failures signalling that reality has intruded
on the illusion of isolation.
99 times out of a hundred you'll probably get away with it, and that one
time you don't--well maybe it won't matter because you can't tell
something broke. La-la-la....
Roy
More information about the Info-ingres
mailing list