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

Could you just delay the COMMIT for a few minutes/seconds/until the user navigates away?

And if the user clicks UNDO, do a ROLLBACK?

Edit: Of course, if anything goes wrong before the COMMIT, you loose the transaction.



That's not really feasible in a real world environment where database connections are frequently re-used and user requests are very short lived.

Database transaction are like try/except blocks - designed to clean up unexpected situations instantly, not as a state mechanism.


Thank you for the answer and explanation!




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

Search: