Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/lsp4you/public_html/connect.php on line 2
This locking mechanism has two states for a data item:
The above locking method will not solve the problem of concurrent transactions. So locking should be done with some logic in order to make sure that locking results in no concurrency related problem.
Thus, the locking as above when we obtain all the locks at the beginning of the transaction and release them at the end ensures that transactions are executed with no concurrency related problem. However, such a scheme limits the concurrency.