docs: void doSingleRegister(RuntimeObject rtObject, int lockMode)
              throws LockNotGrantedException, PersistenceBrokerException
      {
          if(log.isDebugEnabled()) log.debug("Register object " + rtObject.getIdentity());
          Object objectToRegister = rtObject.getObj();
          /*
          if the object is a Proxy there are two options:
          1. The proxies real subject has already been materialized:
             we take this real subject as the object to register and proceed
             as if it were a ordinary object.
          2. The real subject has not been materialized: Then there is nothing
             to be registered now!
             Of course we might just materialize the real subject to have something
             to register. But this would make proxies useless for ODMG as proxies would
             get materialized even if their real subjects were not used by the
             client app.
             Thus we register the current transaction as a Listener to the IndirectionHandler
             of the Proxy.
             Only when the IndirectionHandler performs the materialization of the real subject
             at some later point in time it invokes callbacks on all it's listeners.
             Using this callback we can defer the registering until it's really needed.
          */
          if(rtObject.isProxy())
          {
              IndirectionHandler handler = rtObject.getHandler();
              if(handler == null)
              {
                  throw new OJBRuntimeException("Unexpected error, expect an proxy object as indicated: " + rtObject);
              }
              if (handler.alreadyMaterialized())
              {
                  objectToRegister = handler.getRealSubject();
              }
              else
              {
                  registerToIndirectionHandler(handler);
                  registerUnmaterializedLocks(rtObject.getObj());
                  // all work is done, so set to null
                  objectToRegister = null;
              }
          }
          // no Proxy and is not null, register real object
          if (objectToRegister != null)
          {
              ObjectEnvelope envelope = objectEnvelopeTable.getByIdentity(rtObject.getIdentity());
              // if we found an envelope, object is already registered --> we do nothing
              // than refreshing the object!
              if ((envelope == null))
              {
                  // register object itself
                  envelope = objectEnvelopeTable.get(rtObject.getIdentity(), objectToRegister, rtObject.isNew());
              }
              else
              {
                  /*
                  arminw:
                  if an different instance of the same object was locked again
                  we should replace the old instance with new one to make
                  accessible the changed fields
                  */
                  envelope.refreshObjectIfNeeded(objectToRegister);
              }
              /*
              arminw:
              For better performance we check if this object has already a write lock
              in this case we don't need to acquire a write lock on commit
              */
              if(lockMode == Transaction.WRITE)
              {
                  // signal ObjectEnvelope that a WRITE lock is already acquired
                  envelope.setWriteLocked(true);
              }
          }
      }