private void checkForConflict(TXRegionLockRequestImpl rr, IdentityArrayList localLocks)
      throws CommitConflictException {
    Object r = getRegionObject(rr);
    Map keys = rr.getKeys();

    Object oldValue = regionLocks.put(r, keys);
    if (oldValue != null) {
      try {
        // we may have a conflict
        if (oldValue instanceof Map) {

          checkSetForConflict(rr, (Map) oldValue, keys, localLocks);
          IdentityArrayList newValue = new IdentityArrayList(2);
          newValue.add(oldValue);
          newValue.add(keys);
          regionLocks.put(r, newValue);
        } else {
          IdentityArrayList al = (IdentityArrayList) oldValue;
          int alSize = al.size();
          Object[] alArray = al.getArrayRef();
          for (int i = 0; i < alSize; i++) {
            checkSetForConflict(rr, (Map) alArray[i], keys, localLocks);
          }
          al.add(keys);
          regionLocks.put(r, al); // fix for bug 36689
        }
      } catch (CommitConflictException ex) {
        // fix for bug 36689
        regionLocks.put(r, oldValue);
        throw ex;
      }
    }
  }
keys are LocalRegion; values are ArrayList of Sets of held locks.
geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java