I have a web application which needs to send multiple Ajax request to a PHP page (backend.php)
There is an Oracle table, let's say T1 with 2 int fields min and max (for this example is enough, actually it's a bit more complex).
Backend.php needs to read mix and max, update these values (let's say min += 2, max += 3), then return min and max via some JSON.
In this case I can't use Oracle Sequences (because in the real application there are N rows).
I want to put a lock on the row, to avoid different Ajax calls reading the same values from the row.
I tried to run (via PHP's OCI) something like SELECT a, b FROM t1 FOR UPDATE SKIP LOCKED
but it seems not to work, 2 Ajax calls sometimes return the same A and B values.
How can I make locks working? Is there a better way? Thank you.