[hibernate-dev] NonStrictReadWriteEhcacheEntityRegionAccessStrategy removes the region Cache key twice

Mihalcea Vlad mih_vlad at yahoo.com
Tue May 5 06:55:52 EDT 2015


Hi,

When an entity is updated for the "CacheConcurrencyStrategy.NONSTRICT_READ_WRITE", the cache entry is removed twice:

1. Once from update:

public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
      throws CacheException {
   remove( key );
   return false;
}

2. From unlockItem:

@Override
public void unlockItem(Object key, SoftLock lock) throws CacheException {
    region().remove( key );
}

Shouldn't this be called only once, either from update or from unlockItem, which is called in doAfterTransactionCompletion? 

Vlad Mihalcea 
 


     On Tuesday, May 5, 2015 1:52 PM, Mihalcea Vlad <mih_vlad at yahoo.com> wrote:
   

 Hi,
When an entity is updated for the "CacheConcurrencyStrategy.NONSTRICT_READ_WRITE", the cache entry is removed twice:
1. Once from update:public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
      throws CacheException {
   remove( key );
   return false;
}


Vlad Mihalcea



  


More information about the hibernate-dev mailing list