if (trace) log.trace("Number of entries in context: {0}", entries.size());
if (commit) {
while (it.hasNext()) {
Map.Entry<Object, CacheEntry> e = it.next();
CacheEntry entry = e.getValue();
Object key = e.getKey();
boolean needToUnlock = lockManager.possiblyLocked(entry);
// could be null with read-committed
if (entry != null && entry.isChanged()) {
commitEntry(ctx, entry);
} else {
if (trace) log.trace("Entry for key {0} is null, not calling commitUpdate", key);
}
// and then unlock
if (needToUnlock) {
if (trace) log.trace("Releasing lock on [" + key + "] for owner " + owner);
lockManager.unlock(key, owner);
}
}
} else {
while (it.hasNext()) {
Map.Entry<Object, CacheEntry> e = it.next();
CacheEntry entry = e.getValue();
Object key = e.getKey();
boolean needToUnlock = lockManager.possiblyLocked(entry);
// could be null with read-committed
if (entry != null && entry.isChanged()) entry.rollback();
else {
if (trace) log.trace("Entry for key {0} is null, not calling rollbackUpdate", key);
}
// and then unlock
if (needToUnlock) {