What are the two types of concurrency?

Answer Posted / afan

When many people attempt to modify data in a database at
the same time, a system of controls must be implemented so
that modifications made by one person do not adversely
affect those of another person. This is called concurrency
control.

Concurrency control theory has two classifications for the
methods of instituting concurrency control:

Pessimistic concurrency control
A system of locks prevents users from modifying data in a
way that affects other users. After a user performs an
action that causes a lock to be applied, other users cannot
perform actions that would conflict with the lock until the
owner releases it. This is called pessimistic control
because it is mainly used in environments where there is
high contention for data, where the cost of protecting data
with locks is less than the cost of rolling back
transactions if concurrency conflicts occur.

Optimistic concurrency control
In optimistic concurrency control, users do not lock data
when they read it. When a user updates data, the system
checks to see if another user changed the data after it was
read. If another user updated the data, an error is raised.
Typically, the user receiving the error rolls back the
transaction and starts over. This is called optimistic
because it is mainly used in environments where there is
low contention for data, and where the cost of occasionally
rolling back a transaction is lower than the cost of
locking data when read.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is create command?

700


What are dml triggers and types of dml triggers?

714


What according to you is the difference between mysql and sql server performance?

766


How many databases instances are there in sql server 2000?

752


How to locate and take substrings with charindex() and substring() functions?

697






Where views are stored in sql server?

723


How do you open a cluster administrator?

785


How to modify an existing stored procedure in ms sql server?

738


Explain what is public role in sql server?

788


What is report rendering ?

131


What is the Disadvantage of indexed sequential file.

781


How will you decide the active and passive nodes?

791


What do you understand by physical_only option in dbcc checkdb?

747


What is the data type of time?

689


What do you understand by the denormalisation?

711