docs: protected void lock(ManagedObject managedObject)
                      throws ObjectManagerException
      {
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this, cclass
                          , "lock"
                          , "managedObject=" + managedObject + "(ManagedObject)");
  
          // TODO Should take transaction as an argument and check it like add(),replace() etc do.
  
          // Drive the lock method for the ManagedObject, without holding the synchronized lock
          // on the InternalTransaction. Do this because the lock might block in wait(),
          // stalling this transaction and hence blocking the checkpoint thread.
          managedObject.lock(transactionLock);
  
          synchronized (this) {
              // Now include the ManagedObject in the transaction.
              includedManagedObjects.put(managedObject.owningToken,
                                         managedObject);
              // Set the logSequenceNumber to keep commit(), backout() and checkpoint() happy.
              // Any subsequent update will superceed the zero log sequence number.
              if (!logSequenceNumbers.containsKey(managedObject.owningToken)) {
                  logSequenceNumbers.put(managedObject.owningToken,
                                         new Long(0));
                  managedObjectSequenceNumbers.put(managedObject.owningToken,
                                                   new Long(0));
              } // if (!logSequenceNumbers.containsKey)...
          } // synchronized (this).
  
          // Now check that the transactionLock is still held because a bad application might
          // have another thread that just commited the transaction , or the ObjectManager might have
          // backed it out bacause it was too busy. If the lock is no longer good then notify
          // the ManagedObject in case any other threads are now waiting for the lock.
          // This strategy avoids holding a lock on ManagedObject and Transaction at the same time.
          if (!transactionLock.isLocked()) {
              synchronized (managedObject) {
                  managedObject.notify();
              } // synchronized (managedObject).
          } // if( !transactionLock.isLocked()).
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this,
                         cclass,
                         "lock");
      }