code: public void preReplace(Transaction transaction)
                      throws ObjectManagerException
      {
          final String methodName = "preReplace";
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this, cclass, methodName, new Object[] { transaction });
  
          // A subclass may override this method to do its own replace processing before the log
          // has been written.
  
          // Check the transaction holds the lock.  
          if (transactionLock.getLockingTransaction() != transaction.internalTransaction) {
              if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                  trace.exit(this, cclass, methodName, new Object[] { transaction,
                                                                     transactionLock });
              throw new InvalidTransactionException(this
                                                    , transaction.internalTransaction
                                                    , transactionLock);
          } // if (transactionLock...
  
          testState(nextStateForReplace); // Test the state change.
          // Bump the updateSequence to indicate the current version of the ManagedObject.
          // The caller is protected by the transaction lock.
          // The updateSequence is only meaningful while that lock is held.
          updateSequence++;
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this, cclass, methodName);
      }
docs: Driven when the transaction is getting ready to replace a ManagedObject in an object store The object must have
  previously been locked. The after image has not been captured so the ManagedObject can still be changed.
  
  A subclass may override this method to do its own replace processing before the log has been written.
  
  @param transaction controling the replacement.
  @throws ObjectManagerException