What are Concurrency Conflicts with regards to SQL database?
Thanks
What are Concurrency Conflicts with regards to SQL database?
Thanks
Hi, Concurrency Conflicts occur when two transaction try to lock one resource at the database.There are many tutorials on this just use google to find some.Here is link to one link text
I believe that transaction isolation problems (e.g. non-repeatable read, phantom read, dirty read) are at least part of what you are looking for. See more e.g. here: http://en.wikipedia.org/wiki/Isolation_%28database_systems%29
Assume you have an SQL statement, e.g., UPDATE table SET a = a + 1 WHERE ...
, which would correspond to the following code:
read a
a = a + 1
write a
Assume that two clients A and B execute this simultaneously. The following could happen (time flows from top to bottom):
A B
read a
read a
a = a + 1
write a
a = a + 1
write a
What happens? a
is incremented only once, although it should have been incremented twice. This is a classical concurrency conflict. To avoid such conflicts, databases use transactions and locks.