OW2 Consortium perseus

Compare Revisions

Ignore whitespace Rev 623 → Rev 624

/trunk/persistence/src/org/objectweb/perseus/persistence/lib/TransactionalPersistenceManagerImpl.java
188,7 → 188,7
// There are concurrent accesses.
ce = cache.lookup(oid);
if (ce == null) {
logger.log(BasicLevel.WARN,
logger.log(BasicLevel.INFO,
"Recursive call for getting a cache entry (oid= "
+ oid + ")");
ce = getCacheEntry(ws, oid);
659,7 → 659,10
return suggestedResource;
}
WorkingSet ws = (WorkingSet) _ws;
State state = null;
State state = ws.lookup(resourceId);
if (state != null && state != VirtualState.instance && !resourceCopyRequired) {
return state;
}
CacheEntry ce = (CacheEntry) resourceHints;
Object po = ce.getCeObject();
// new persistent object from the working set
699,23 → 702,24
state = stateManager.getReferenceState(entryOfCache);
}
if (state == null) {
// no reference state in cache ==> we have to load it
// no reference state in cache
synchronized(synchronizer) {
//check one more time in synchronized block
if (entryOfCache != null) {
state = stateManager.getReferenceState(entryOfCache);
}
if (state == null) {
state = load(ws, entryOfCache);
// no reference state in cache ==> we have to load it
state = load(ws, entryOfCache == null ? ce : entryOfCache);
if (entryOfCache != null) {
// put the state in the cache
stateManager.setReferenceState(entryOfCache, state);
}
}
}
if (entryOfCache != null) {
// put the state in the cache
stateManager.setReferenceState(entryOfCache, state);
}
} //else state has been found from the cache
// ALWAYS clone found state and use it as reference state for the
 
// ALWAYS clone the found state and use it as reference state for the
// cache entry used in the working set
state = stateManager.createState(state);
stateManager.makeClean(state);
880,11 → 884,6
+ " / oid=" + oid);
}
assertOpenWorkingset(ws);
 
 
 
 
 
return getCacheEntry(ws, oid);
}