3

What are Concurrency Conflicts with regards to SQL database?

1

3 Answers 3

6

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.

0
1

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

0

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.