code: public void updateRecord(final ORecordInternal<?> fresh) {
      if (!isEnabled() || fresh == null || fresh.isDirty() || fresh.getIdentity().isNew() || !fresh.getIdentity().isValid()
          || fresh.getIdentity().getClusterId() == excludedCluster)
        return;
  
      if (fresh.isPinned() == null || fresh.isPinned()) {
        underlying.lock(fresh.getIdentity());
        try {
          final ORecordInternal<?> current = underlying.get(fresh.getIdentity());
          if (current != null && current.getVersion() >= fresh.getVersion())
            return;
  
          if (ODatabaseRecordThreadLocal.INSTANCE.isDefined() && !ODatabaseRecordThreadLocal.INSTANCE.get().isClosed())
            // CACHE A COPY
            underlying.put((ORecordInternal<?>) fresh.flatCopy());
          else {
            // CACHE THE DETACHED RECORD
            fresh.detach();
            underlying.put(fresh);
          }
        } finally {
          underlying.unlock(fresh.getIdentity());
        }
      } else
        underlying.remove(fresh.getIdentity());
    }
docs: Push record to cache. Identifier of record used as access key
  
  @param fresh
  new record that should be cached