Skip to content

Commit

Permalink
ignite-7377 Correctly re-create cache entry for tx entry
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Jan 11, 2018
1 parent 2de75fd commit ba9c110
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ private boolean lockMultiple(IgniteInternalTx tx, Iterable<IgniteTxEntry> entrie
if (txEntry2 == txEntry1)
break;

txEntry2.cached().txUnlock(tx);
txUnlock(tx, txEntry2);
}

return false;
Expand Down Expand Up @@ -1647,6 +1647,33 @@ private boolean lockMultiple(IgniteInternalTx tx, Iterable<IgniteTxEntry> entrie
return true;
}

/**
* @param tx Transaction.
* @param txEntry Entry to unlock.
*/
private void txUnlock(IgniteInternalTx tx, IgniteTxEntry txEntry) {
while (true) {
try {
txEntry.cached().txUnlock(tx);

break;
}
catch (GridCacheEntryRemovedException ignored) {
if (log.isDebugEnabled())
log.debug("Got removed entry in TM txUnlock(..) method (will retry): " + txEntry);

try {
txEntry.cached(txEntry.context().cache().entryEx(txEntry.key(), tx.topologyVersion()));
}
catch (GridDhtInvalidPartitionException e) {
tx.addInvalidPartition(txEntry.context(), e.partition());

break;
}
}
}
}

/**
* @param tx Owning transaction.
* @param entries Entries to unlock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@ public static String toString(String str, String name, @Nullable Object val) {
*/
@SuppressWarnings({"ConstantConditions", "unchecked"})
public static <T> String arrayToString(Class arrType, Object arr) {
if (arr == null)
return "null";

T[] array = (T[])arr;

if (array.length > COLLECTION_LIMIT)
Expand Down

0 comments on commit ba9c110

Please sign in to comment.