docs: protected void checkpoint(InternalTransaction internalTransaction,
                                ObjectManagerByteArrayOutputStream serializedBytes,
                                long savedSequenceNumber)
                      throws ObjectManagerException
      {
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this,
                          cclass,
                          "checkpoint",
                          new Object[] { internalTransaction,
                                        serializedBytes,
                                        new Long(savedSequenceNumber) });
  
          if (lockedBy(internalTransaction)) { // Locking update?   
              switch (state) {
                  case stateAdded:
                      synchronized (forcedUpdateSequenceLock) {
                          // Now give the ManagedObnject to the ObjectStore, if we have a newer version.     
                          if (savedSequenceNumber > forcedUpdateSequence) {
                              forcedUpdateSequence = savedSequenceNumber;
                              latestSerializedBytes = serializedBytes;
                              // TODO It is possible that nothing has changed since the last time we checkpointed this
                              //      if the transaction is long running so the addition of the same thing  to the Object
                              //      store might be pointless.
                              owningToken.objectStore.add(this, true);
                          } // if (savedSequenceNumber > forcedUpdateSequence). 
                      } // synchronized (forcedUpdateSequenceLock).
                      break;
  
                  case stateReplaced:
                      // The replaced image is written as part of the TransactionCheckpointLogRecord and must 
                      // not be given to the ObjectStore because we dont yet know whether it will commit.
                      break;
  
                  case stateToBeDeleted:
                  case stateMustBeDeleted:
                      synchronized (forcedUpdateSequenceLock) {
                          if (savedSequenceNumber > forcedUpdateSequence) {
                              if (serializedBytes != null) {
                                  // We have to consider including toBeDeleted Objects because they have not yet been deleted. 
                                  // The forcedSerializedBytes passed in may not be null if another OptimisticReplace happened to this
                                  // ManagedObject after Delete had been logged. This happens when two links are deleted in a LinkedList 
                                  // under one transaction. If the serialized bytes are null we leave the ObjectStore version alone and 
                                  // let another transaction place its version in the store. We will only delete them when the
                                  // transaction commits.
                                  forcedUpdateSequence = savedSequenceNumber;
                                  latestSerializedBytes = serializedBytes;
                                  owningToken.objectStore.add(this, true);
                              } // if (serializedBytes != null). 
                          } // if (savedSequenceNumber > forcedUpdateSequence).
                      } // synchronized (forcedUpdateSequenceLock).
                      break;
  
              } // switch.
  
          } else { // OptimisticReplace update.
              synchronized (forcedUpdateSequenceLock) {
                  if (savedSequenceNumber > forcedUpdateSequence) {
                      forcedUpdateSequence = savedSequenceNumber;
                      // Did we checkpoint an OptimisticReplace after some other transaction has subsequently deleted us.
                      if (state != stateDeleted) {
                          latestSerializedBytes = serializedBytes;
                          owningToken.objectStore.add(this, true);
                      } // if (state != stateDeleted).
                  } // if (savedSequenceNumber > forcedUpdateSequence).
              } // synchronized (forcedUpdateSequenceLock).
          } // if (lockedBy(transaction)).
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this,
                         cclass,
                         "checkpoint");
      }