Concurency problem with Isolation - read-committed

Posted by Ratn Deo--Dev on Stack Overflow See other posts from Stack Overflow or by Ratn Deo--Dev
Published on 2010-06-01T10:42:30Z Indexed on 2010/06/01 10:43 UTC
Read the original article Hit count: 356

Filed under:
|
|

I have to write a simple demo for amount withdrawl from a joint Bank amount .Andy and Jen holds a joint bank account with number 123 . Suppose they have 100$ in their account .Jen and Andy are operating their account at the same time and both are trying to withdraw 90$ at the time being .My transaction Isolation is set to read-committed and both are able to withdraw money leaving the balance to -(minus)80$ although I have constraint that balance should never be less than 0.

I am using hibernate .Is versioning only way to solve this problem or I should go for another Isolation level ?

© Stack Overflow or respective owner

Related posts about design

Related posts about hibernate