docs: protected void commit(Transaction transaction
                            , ObjectManagerByteArrayOutputStream serializedBytes
                            , long savedSequenceNumber
                            , boolean requiresCurrentCheckpoint
                      )
                                      throws ObjectManagerException
      {
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this,
                          cclass,
                          "commit",
                          new Object[] { transaction,
                                        serializedBytes,
                                        new Long(savedSequenceNumber),
                                        new Boolean(requiresCurrentCheckpoint) });
          // No need to synchronize when we copy the entry state as only the locking transaction can cause a state change. 
          int entryState = state;
          setState(nextStateForCommit); // Make the state change. 
  
          // Update the object in its store. 
          // We do this only after the add/replace/delete records has been written and forced
          // to the log as part of commit processing.
          switch (entryState) {
              case stateAdded:
              case stateReplaced:
                  synchronized (forcedUpdateSequenceLock) {
                      // Now the object to give the ObjectStore, if we have a newer version.     
                      if (savedSequenceNumber > forcedUpdateSequence) {
                          forcedUpdateSequence = savedSequenceNumber;
                          latestSerializedBytes = serializedBytes;
                          owningToken.objectStore.add(this, requiresCurrentCheckpoint);
                      } // if (savedSequenceNumber > forcedUpdateSequence).
                  } // synchronized (forcedUpdateSequenceNumberLock).
                  break;
  
              case stateToBeDeleted:
              case stateMustBeDeleted:
                  // An OptimisticReplace for another transaction might have been executed and commited after our delete but
                  // but before this commit, in which case the commited version could legitimately be greater than the 
                  // one that deleted the Object.
  
                  // Taking the forcedUpdateSequenceLock, ensures that any OptimisticReplace 
                  // updates see our state is now deleted.
                  int tempLatestSerializedSize;
                  synchronized (forcedUpdateSequenceLock) {
                      if (savedSequenceNumber > forcedUpdateSequence) {
                          forcedUpdateSequence = savedSequenceNumber;
                          // 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.
                          // latestSerializedBytes might be null if they have been written by the store.
                          if (latestSerializedBytes != null) {
                              owningToken.objectStore.getObjectManagerState().returnByteArrayOutputStreamToPool(latestSerializedBytes);
                              latestSerializedBytes = null;
                          } // if (latestSerializedBytes != null).
                      } // if (savedSequenceNumber > forcedUpdateSequenceNumber).
  
                      // Remove the object from its object store. If an OptimisticReplace committed before we committed
                      // the delete, then the log version will have already been bumped up, so delete the object
                      // irrespective of whether it was changed by an optimisticReplace in another transaction after
                      // we deleted it in this transaction. Also a checkpoint may have already noticed that the
                      // logSequence number has moved on.
                      owningToken.objectStore.remove(owningToken,
                                                     requiresCurrentCheckpoint);
                      tempLatestSerializedSize = latestSerializedSize;
                      latestSerializedSize = 0;
                  } // synchronized (forcedUpdateSequenceLock).
                    // following statement moved out of lock in PM41418 to prevent deadlock
                  owningToken.objectStore.reserve(-tempLatestSerializedSize, false);
                  break;
  
          } // switch.
  
          beforeImmage = null; // Help garbage collector.
          numberOfLocksTaken = 0;
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this,
                         cclass,
                         "commit");
      }