code: public int lockThisRecord(Task objSession, String strDatabaseName, String strRecordName, Object bookmark, String strUserName, int iLockType)
          throws DBException
      {
          SessionInfo sessionInfo = this.getLockSessionInfo(objSession, strUserName);
          try {
              return this.getRemoteLockSession(sessionInfo).lockThisRecord(strDatabaseName, strRecordName, bookmark, sessionInfo, iLockType);
          } catch (RemoteException ex)   {
              throw DatabaseException.toDatabaseException(ex);
          }
      }
docs: Lock this bookmark in this record for this session.
  @param strRecordName The record to create the lock in.
  @param bookmark The bookmark to lock.
  @param objSession The session that wants the lock.
  @param strUser The name of the user that wants the lock.
  @param iLockType The type of lock (wait or error lock).
  @return null if successful, the name of the user locking if not.