Hacker News new | ask | show | jobs
by Avery3R 1087 days ago
BEGIN TRANSACTION;

... ; Modify DB

... ; Inspect State

ROLLBACK TRANSACTION;

and then switch the rollback to commit when satisfied

1 comments

This is cool I probably will do this.
Just mind the isolation level of concurrent queries which may be running. By default you are probably fine since it's usually snapshot isolation mode (will only see committed results as of query start) but there are other modes that break this.