[HHH-5599] (NPE occurs when using Infinispan as L2 Cache) Merged from trunk.
This commit is contained in:
parent
da27e3545e
commit
c705528613
|
@ -266,7 +266,7 @@ public class PutFromLoadValidator {
|
||||||
PendingPutMap pending = pendingPuts.get(key);
|
PendingPutMap pending = pendingPuts.get(key);
|
||||||
if (pending != null) {
|
if (pending != null) {
|
||||||
if (pending.size() == 0) {
|
if (pending.size() == 0) {
|
||||||
pendingPuts.remove(key);
|
pendingPuts.remove(key, pending);
|
||||||
}
|
}
|
||||||
pending.releaseLock();
|
pending.releaseLock();
|
||||||
}
|
}
|
||||||
|
@ -561,10 +561,12 @@ public class PutFromLoadValidator {
|
||||||
try {
|
try {
|
||||||
PendingPut cleaned = map.remove(toClean.owner);
|
PendingPut cleaned = map.remove(toClean.owner);
|
||||||
if (toClean.equals(cleaned) == false) {
|
if (toClean.equals(cleaned) == false) {
|
||||||
// Oops. Restore it.
|
if (cleaned != null) {
|
||||||
map.put(cleaned);
|
// Oops. Restore it.
|
||||||
|
map.put(cleaned);
|
||||||
|
}
|
||||||
} else if (map.size() == 0) {
|
} else if (map.size() == 0) {
|
||||||
pendingPuts.remove(toClean.key);
|
pendingPuts.remove(toClean.key, map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
Loading…
Reference in New Issue