DataCachePCData data = cache.get(sm.getObjectId());
// If loadedFieldsChanged = true, we don't care that data was already stored as we should update it.
boolean alreadyCached = (data != null && !loadedFieldsChanged);
DataCacheStoreMode storeMode = fetch.getCacheStoreMode();
if ((storeMode == DataCacheStoreMode.USE && !alreadyCached) || storeMode == DataCacheStoreMode.REFRESH) {
// If not found in the DB and the item is in the cache, and not locking remove the item
if (!found && data != null && !isLocking(fetch)) {
cache.remove(sm.getObjectId());