Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3124

AtomicHashMap.put is not atomic with pessimistic locking

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.3.0.CR2, 5.3.0.Final
    • 5.2.7.Final, 5.3.0.Beta1
    • Core
    • None
    • Workaround Exists
    • Hide

      Use AdvancedCache.lock to lock the atomic map key explicitly before modifying it.

      Show
      Use AdvancedCache.lock to lock the atomic map key explicitly before modifying it.

      When the user calls AtomicHashMap.put(k, v), AtomicHashMapProxy.getDeltaMapForWrite() first reads the atomic map in the invocation context, and only acquires a lock afterwards.

      Between the read and the lock, another transaction can write something to the atomic map, and that write will be lost.

            dberinde@redhat.com Dan Berindei (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: