Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

BEGIN TRANSACTION;

... ; Modify DB

... ; Inspect State

ROLLBACK TRANSACTION;

and then switch the rollback to commit when satisfied



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: