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 LSP4YOU - Learner's Support Publications

Binary Locks

This locking mechanism has two states for a data item:

  • Locked
  • Unlocked
Consider the following schedules:
Incorrect Locking

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.

Locking

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.