Re:Practical Guide to SQL Transaction Isolation
by aidos on Wednesday August 02, 2017 @11:22AM
(#14911239)
Thanks for the extra detail; it's always good to hear of any gotchas. In my system a lot of what happens is effectively a single user operates on a subset of data that nobody else touches but I'll definitely to a named lock prototype before I go down any particular path.
Also, locks using FOR UPDATE don't have explicit lock mechanics. You can't check if that row is locked. You can't easily control the timeout. I consider it a bandaid technique. Bandaids are great for small boo boos, but they don't work if you already have a codebase that is complex and does things in an inconsistent order.