@Override
  protected void commitContextEntry(
      CacheEntry entry,
      InvocationContext ctx,
      FlagAffectedCommand command,
      Metadata metadata,
      Flag stateTransferFlag,
      boolean l1Invalidation) {
    if (ctx.isInTxScope() && stateTransferFlag == null) {
      Metadata commitMetadata;
      // If user provided version, use it, otherwise generate/increment accordingly
      ClusteredRepeatableReadEntry clusterMvccEntry = (ClusteredRepeatableReadEntry) entry;
      EntryVersion existingVersion = clusterMvccEntry.getMetadata().version();
      EntryVersion newVersion;
      if (existingVersion == null) {
        newVersion = versionGenerator.generateNew();
      } else {
        newVersion = versionGenerator.increment((IncrementableEntryVersion) existingVersion);
      }

      if (metadata == null)
        commitMetadata = new EmbeddedMetadata.Builder().version(newVersion).build();
      else commitMetadata = metadata.builder().version(newVersion).build();

      cdl.commitEntry(entry, commitMetadata, command, ctx, null, l1Invalidation);
    } else {
      // This could be a state transfer call!
      cdl.commitEntry(entry, entry.getMetadata(), command, ctx, stateTransferFlag, l1Invalidation);
    }
  }
  @Override
  protected void commitContextEntry(
      CacheEntry entry, InvocationContext ctx, boolean skipOwnershipCheck) {
    if (ctx.isInTxScope()) {
      ClusteredRepeatableReadEntry clusterMvccEntry = (ClusteredRepeatableReadEntry) entry;
      EntryVersion existingVersion = clusterMvccEntry.getVersion();

      EntryVersion newVersion;
      if (existingVersion == null) {
        newVersion = versionGenerator.generateNew();
      } else {
        newVersion = versionGenerator.increment((IncrementableEntryVersion) existingVersion);
      }
      commitEntry(entry, newVersion, skipOwnershipCheck);
    } else {
      // This could be a state transfer call!
      commitEntry(entry, entry.getVersion(), skipOwnershipCheck);
    }
  }