gabordemooij/redbean — Issue #119: Anyway to 'lock' a Bean?
Author: tjlytle
Created: 2011-12-23 16:39:52+00:00
State: open

When using SQL directly, I've used an update/select process to 'lock' records to a process:

UPDATE table SET claimed = $id WHERE claimed = NULL LIMIT 1;
SELECT table WHERE claimed = $id;

If the select returns nothing, no records where able to be locked.

Is there a way to accomplish something similar with RedBean? There are some old references to `beanOpen()` and `$bean->locked()`, but I haven't found anything that looks current.