docs: public int lockThisRecord(String strDatabaseName, String strRecordName, Object bookmark, SessionInfo sessionInfo, int iLockMode)
          throws DBException, RemoteException
      {
          sessionInfo.m_iRemoteSessionID = this.getSessionID();
          LockTable lockTable = this.getLockTable(strDatabaseName, strRecordName);
          SessionInfo sessionLocking = lockTable.addLock(bookmark, sessionInfo);
          if (sessionInfo.equals(sessionLocking))
          	sessionLocking = null;		// Ignore if I'm the one who is already locking it.
          if (sessionLocking != null)    // Someone is already locking it
              if (((iLockMode & DBConstants.OPEN_WAIT_FOR_LOCK_STRATEGY) == DBConstants.OPEN_WAIT_FOR_LOCK_STRATEGY) || ((iLockMode & DBConstants.OPEN_MERGE_ON_LOCK_STRATEGY) == DBConstants.OPEN_MERGE_ON_LOCK_STRATEGY))
          {   // Wait for lock
              sessionLocking = lockTable.waitForUnlockAndLock(bookmark, sessionInfo, this.getLockTimeout());
              if (sessionLocking == null)
              	return DBConstants.RECORD_CHANGED;	// Lock is okay, but the data has possibly changed
              else if ((iLockMode & DBConstants.OPEN_EXCEPTION_ON_LOCK_TYPE) != DBConstants.OPEN_EXCEPTION_ON_LOCK_TYPE)
                  return DBConstants.ERROR_RETURN;    // Exception not returned
          }
          if (sessionLocking != null)
              if ((iLockMode & DBConstants.OPEN_EXCEPTION_ON_LOCK_TYPE) == DBConstants.OPEN_EXCEPTION_ON_LOCK_TYPE)
          {
              String strError = "Record locked by {0}";
              if (((iLockMode & DBConstants.OPEN_WAIT_FOR_LOCK_STRATEGY) == DBConstants.OPEN_WAIT_FOR_LOCK_STRATEGY) || ((iLockMode & DBConstants.OPEN_MERGE_ON_LOCK_STRATEGY) == DBConstants.OPEN_MERGE_ON_LOCK_STRATEGY))
                  strError = "Lock Timeout error - locked by {0}";
              strError = this.getTask().getString(strError);
              String strUserName = sessionLocking.m_strUserName;
              if (strUserName == null)
                  strUserName = "Unknown user";
              strError = MessageFormat.format(strError, strUserName);
              throw new DBException(strError);
          }
          return (sessionLocking == null ? DBConstants.NORMAL_RETURN : DBConstants.ERROR_RETURN);    // Success if nothing returned
      }