2 Replies Latest reply on Mar 30, 2015 4:20 AM by Yair Ogen

    Pessimistic Locking and dirty reads

    Yair Ogen Expert

      I am using Infinispan 7.1.1.

       

      When using transactions with thw wrote lock flag:

       

      cache.getAdvancedCache.withFlags(Flag.FORCE_WRITE_LOCK).get(id)
      

       

      How do we handle dirty reads? I.w. assume 2 threads reading the data with write flag, how do we correlate the changes so that once first thread updates the cache the other won't simply override the new cache with it's own value? I want to other thread to know it's data is dirty and allow it to see the other updated entry?

       

      Or maybe FORCE_WRITE_LOCK is not what I should use?