Concurrency
Concurrency is allowing simultaneous access of same data by different users. Locks useful for accessing the database are
1. Exclusive
The exclusive lock is useful for locking the row when an insert, update or delete is being done. This lock should not be applied when we do only select from the row.
2. Shared lock
We can do the table as Share Lock as many share locks can be put on the same resource. (Scoot, 2000-2009)
Transaction
Transaction is sequence of information exchanging and related work that is treated as a unit for the purposes of satisfying a request and data integrity. Database transaction should enforce the ACID rules.
Atomicity- all task in a transaction must happen or none of them. Transaction must be completed or must not complete.
Consistency- transaction takes database from one consistent state to another.
Isolation- two simultaneous transactions cannot interfere with one another. Intermediate results within a transaction must remain invisible to other transaction.
Durability- Completed transactions cannot be aborted later or their results discarded. The changes applied to the database by a committed transaction must persist in the DB. The changes must not be lost because of failure.
Reference
Scoot, W (2000-2009). Introduction to Concurrency Control. Retrieved on 22/05/2010 from http://www.agiledata.org/essays/concurrencyControl.html

No comments:
Post a Comment