docs: protected synchronized void prepare(Transaction transaction)
                      throws ObjectManagerException
      {
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this, cclass
                          , "prepare"
                          , "transaction=" + transaction + "(Trasnaction)"
                              );
  
          // 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) {
              if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                  trace.exit(this, cclass,
                             "prepare",
                             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).
  
          prePrepare(transaction); // Give ManagedObjects a chance to get ready.
  
          // Is there any logging to do?
          if (state == statePrePreparedPersistent) { // Logging work to do.
  
              TransactionPrepareLogRecord transactionPrepareLogRecord = new TransactionPrepareLogRecord(this);
              objectManagerState.logOutput.writeNext(transactionPrepareLogRecord
                                                     , 0
                                                     , true
                                                     , true);
          } // If logging work to do.
  
          // ManagedObjects do nothing at prepare time.
  //    // Drive prepare method of objects included in this transaction.
  //    for (java.util.Iterator managedObjectIterator = includedManagedObjects.iterator();
  //         managedObjectIterator.hasNext();
  //         ) {
  //      ManagedObject managedObject = (ManagedObject)managedObjectIterator.next();
  //      managedObject.prepare(transaction);
  //    }                                            // for... includedManagedObjects.
  
          setState(nextStateForPrepare);
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this, cclass
                         , "prepare"
                              );
      }