code: void doSingleLock(ClassDescriptor cld, Object obj, Identity oid, int lockMode) throws LockNotGrantedException
      {
          LockManager lm = implementation.getLockManager();
          if (cld.isAcceptLocks())
          {
              if (lockMode == Transaction.READ)
              {
                  if (log.isDebugEnabled()) log.debug("Do READ lock on object: " + oid);
                  if(!lm.readLock(this, oid, obj))
                  {
                      throw new LockNotGrantedException("Can not lock for READ: " + oid);
                  }
              }
              else if (lockMode == Transaction.WRITE)
              {
                  if (log.isDebugEnabled()) log.debug("Do WRITE lock on object: " + oid);
                  if(!lm.writeLock(this, oid, obj))
                  {
                      throw new LockNotGrantedException("Can not lock for WRITE: " + oid);
                  }
              }
              else if (lockMode == Transaction.UPGRADE)
              {
                  if (log.isDebugEnabled()) log.debug("Do UPGRADE lock on object: " + oid);
                  if(!lm.upgradeLock(this, oid, obj))
                  {
                      throw new LockNotGrantedException("Can not lock for UPGRADE: " + oid);
                  }
              }
          }
          else
          {
              if (log.isDebugEnabled())
              {
                  log.debug("Class '" + cld.getClassNameOfObject() + "' doesn't accept locks" +
                          " (accept-locks=false) when implicite locked, so OJB skip this object: " + oid);
              }
          }
      }
docs: Only lock the specified object, represented by
  the {@link RuntimeObject} instance.
  
  @param  cld       The {@link org.apache.ojb.broker.metadata.ClassDescriptor}
  of the object to acquire a lock on.
  @param  oid The {@link org.apache.ojb.broker.Identity} of the object to lock.
  @param  lockMode  lock mode to acquire. The lock modes
  are <code>READ</code> , <code>UPGRADE</code> , and <code>WRITE</code>.
  
  @exception  LockNotGrantedException    Description of Exception