-
1. Re: Isolation levels
galder.zamarreno May 1, 2012 4:38 AM (in response to dushyanttiwari)1 of 1 people found this helpfulThe difference is simple:
With read committed, if between two consecutive read calls on the same key, the key has been updated by another transaction, the second read will return the new updated value:
1. Thread1: tx.begin()
2. Thread1: cache.get(k) returns v
3. Thread2: tx.begin()
4. Thread2: cache.get(k) returns v
5. Thread2: cache.put(k, v2)
6. Thread2: tx.commit()
7. Thread1: cache.get(k) returns v2!
With repeteable read, step 7 will still return v. So, the idea is that if you retrieve the same key multiple times within a transaction, you should use repeteable read.
-
2. Re: Isolation levels
galder.zamarreno May 1, 2012 4:41 AM (in response to galder.zamarreno)Btw, as always, we have tests in the Infinispan code base that show this in action:
-
3. Re: Isolation levels
dushyanttiwari May 2, 2012 4:42 AM (in response to galder.zamarreno)Thanks Galder for the respone.
i think the concept is different from what we have in case of relational databases where locks are aquired even when we read stuff.