3
Would anyone know if there is an SQL calling to run a SELECT
using LOCK IN SHARE MODE
registry and running an UPDATE at the same time? example:
SELECT * FROM Nome_Tabela WHERE id = 5 LOCK IN SHARE MODE (UPDATE AQUI)
Any suggestions? I’m using Mysql.
Using LOCK IN SHARE MODE in an update is not very recommended, because if two users are reading the same content, one of them will end up being lost when the value is updated. To implement the reading of a given value, first perform the reading lock of it, using FOR UPDATE and then increment the value. https://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.html
– Ivan Ferrer