docs: protected void delete(ManagedObject managedObject,
                            Transaction transaction,
                            long logSpaceReservedDelta)
                      throws ObjectManagerException {
          final String methodName = "delete";
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this,
                          cclass,
                          methodName,
                          new Object[] { managedObject,
                                        transaction,
                                        new Long(logSpaceReservedDelta) });
  
          // Make the ManagedObject ready for an deletion,
          // give it a chance to blow up in anything is wrong.
          managedObject.preDelete(transaction);
  
          synchronized (this) {
              // To defend against two application threads completing the same transaction and trying to
              // continue with it at the same time we check that the Transaction still refers to this one,
              // now that we are synchronized on the InternalTransaction.
              if (transaction.internalTransaction != this) {
                  managedObject.postDelete(transaction, false);
                  if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                      trace.exit(this,
                                 cclass,
                                 methodName,
                                 new Object[] { "via InvalidTransactionException",
                                               transaction.internalTransaction });
                  // Same behaviour as if the transaction was completed and replaced by
                  // objectManagerState.dummyInternalTransaction.
                  throw new InvalidStateException(this,
                                                  InternalTransaction.stateTerminated,
                                                  InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
  
              } // if (transaction.internalTransaction != this).
  
              // This object will be removed from the object store once the transaction
              // is commted.
  
              // Is data logging is required for this object in order to recover its
              // removal?
              long logSequenceNumber;
  
              // The following try block catces failures to write the log record.
              try {
                  if (managedObject.owningToken.getObjectStore().getPersistence()) {
                      testState(nextStateForInvolvePersistentObject);
  
                      logSpaceReservedDelta = logSpaceReservedDelta + Token.maximumSerializedSize();
                      if (logSpaceReserved == 0)
                          logSpaceReservedDelta = logSpaceReservedDelta + logSpaceReservedOverhead;
  
                      TransactionDeleteLogRecord transactionDeleteLogRecord = new TransactionDeleteLogRecord(this,
                                                                                                             managedObject.owningToken);
  
                      // If we throw an exception in here no state change has been done.
                      logSequenceNumber = objectManagerState.logOutput.writeNext(transactionDeleteLogRecord, logSpaceReservedDelta,
                                                                                 true, false);
  
                      // The previous testState() call means we should not fail in here.
                      setState(nextStateForInvolvePersistentObject);
  
                      logSpaceReserved = logSpaceReserved + logSpaceReservedDelta;
  
                  } else { // if (token.getObjectStore().persistent).
                      setState(nextStateForInvolveNonPersistentObject);
                      logSequenceNumber = objectManagerState.getDummyLogSequenceNumber();
                  } // If Non Persistent.
              } catch (ObjectManagerException exception) {
                  // The write was not done.
                  // No FFDC Code Needed.
                  ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:1644:1.41");
  
                  // Drive the postDelete method for the object.
                  managedObject.postDelete(transaction, false);
  
                  if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                      trace.exit(this,
                                 cclass,
                                 methodName,
                                 new Object[] { exception });
                  throw exception;
              } //  catch (ObjectManagerException...
  
              loggedSerializedBytes.remove(managedObject.owningToken);
  
              // The ManagedObject is now included in the transaction.
              includedManagedObjects.put(managedObject.owningToken, managedObject);
              // Remember which version it was when we logged it.
              logSequenceNumbers.put(managedObject.owningToken,
                                     new Long(logSequenceNumber));
              managedObjectSequenceNumbers.put(managedObject.owningToken,
                                               new Long(managedObject.getUpdateSequence()));
          } // synchronized (this);
  
          // Drive the postDelete method for the object.
          managedObject.postDelete(transaction, true);
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this, cclass, methodName);
      }