Concurrency model


What is a concurrency model?


When 2 transactions try to simultaneously access same data item it may lead to in consistent state. For example.transaction t1 writing data item Q and t2 also writing at the same time.Therefore either the value written by t1 will persist or value written by t2 will persist, i.e one will overwrite another. This also happens with t1-read and t2-write, t1-write and t2-read.

To solve this problem concurrency model is implemented in a DBMS which can be any of the following given below-

  1. Lock based
    a. Shared lock
    b. exclusive lock
  2. Time stamp based