code: public void lock(Object ownerId, Object resourceId, int targetLockLevel, int compatibility,
                       boolean preferred, long timeoutMSecs, Object isolationId) throws LockException
      {
          timeoutCheck(ownerId);
          GenericLock lock = atomicGetOrCreateLock(resourceId, isolationId);
          super.doLock(lock, ownerId, resourceId, targetLockLevel, compatibility, preferred, timeoutMSecs);
      }
docs: Most flexible way to acquire a lock on a resource. <br>
  <br>
  This method blocks and waits for the lock in case it is not avaiable. If
  there is a timeout or a deadlock or the thread is interrupted a
  LockException is thrown.
  
  @param ownerId         a unique id identifying the entity that wants to acquire this
  lock
  @param resourceId      the resource to get the level for
  @param targetLockLevel the lock level to acquire
  @param compatibility   {@link GenericLock#COMPATIBILITY_NONE}if no additional compatibility is
  desired (same as reentrant set to false) ,
  {@link GenericLock#COMPATIBILITY_REENTRANT}if lock level by the same
  owner shall not affect compatibility (same as reentrant set to
  true), or {@link GenericLock#COMPATIBILITY_SUPPORT}if lock levels that
  are the same as the desired shall not affect compatibility, or
  finally {@link GenericLock#COMPATIBILITY_REENTRANT_AND_SUPPORT}which is
  a combination of reentrant and support
  @param preferred       in case this lock request is incompatible with existing ones
  and we wait, it shall be granted before other waiting requests
  that are not preferred
  @param timeoutMSecs    specifies the maximum wait time in milliseconds
  @param isolationId     the isolation level identity key. See {@link CommonsOJBLockManager}.
  @throws LockException will be thrown when the lock can not be acquired