When to use SELECT … FOR UPDATE?

The only portable way to achieve consistency between rooms and tags and making sure rooms are never returned after they had been deleted is locking them with SELECT FOR UPDATE. However in some systems locking is a side effect of concurrency control, and you achieve the same results without specifying FOR UPDATE explicitly. To solve this problem, Thread … Read more