Get the lock table for this record.
@param strRecordName The record to look up.
@return The lock table for this record (create if it doesn't exist).
422118
public LockTable getLockTable(String strDatabaseName, String strRecordName)
    {
        String strKey = strDatabaseName + ':' + strRecordName;
        LockTable lockTable = (LockTable)m_htLockTables.get(strKey);
        if (lockTable == null)
        {
            synchronized (m_htLockTables)
            {
                if ((lockTable = (LockTable)m_htLockTables.get(strKey)) == null)
                    m_htLockTables.put(strKey, lockTable = new LockTable());
            }
            m_hsMyLockTables.add(lockTable);   // Keep track of the lock tables that I used
        }
        return lockTable;
    }
429467
public Record getTargetRecord(Map<String,Object> properties, String strParam)
    {
        String strRecordName = (String)properties.get(strParam);
        Record record = null;
        if ((strRecordName != null) && (strRecordName.length() > 0))
        {
            String strTableName = strRecordName;
            if (strTableName.indexOf('.') != -1)
                strTableName = strTableName.substring(strTableName.lastIndexOf('.') + 1);
            if (this.getRecordOwner() != null)  // Always
                record = (Record)this.getRecordOwner().getRecord(strTableName);
            if (record != null)
                return record;    // Already open
            if (strRecordName.indexOf('.') == -1)
                if (properties.get("package") != null)
                    strRecordName = (String)properties.get("package") + '.' + strRecordName;
            if (strRecordName.indexOf('.') == -1)
            {
                ClassInfo recClassInfo = new ClassInfo(this.getRecordOwner());
                try {
                    recClassInfo.getField(ClassInfo.CLASS_NAME).setString(strRecordName);
                    recClassInfo.setKeyArea(ClassInfo.CLASS_NAME_KEY);
                    if (recClassInfo.seek(null))
                        strRecordName = recClassInfo.getPackageName(null) + '.' + strRecordName;
                } catch (DBException ex) {
                    ex.printStackTrace();
                } finally {
                    recClassInfo.free();
                }
            }
            if (strRecordName.indexOf('.') != -1)
            {
               record = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(strRecordName);
                if (record != null)
                    record.init(this.findRecordOwner());
            }
        }
        return record;
    }
188050
public RemoteTable getRemoteTable(String strRecordName) throws RemoteException
    {
        BaseTransport transport = this.createProxyTransport(GET_REMOTE_TABLE);
        transport.addParam(NAME, strRecordName);
        String strTableID = (String)transport.sendMessageAndGetReply();
        // See if I have this one already
        TableProxy tableProxy = (TableProxy)this.getChildList().get(strTableID);
        if (tableProxy == null)
            tableProxy = new TableProxy(this, strTableID); // This will add it to my list
        return tableProxy;
    }
300038
public static function getLock($id) {

        $model = get_called_class();
        /* @var $t Record */
        $t = new $model;
        $select = DB::select($t->getTable())->where($t->getPkField(), $id)->lock()->setRecord($model);
        Event::trigger('record_before_select', [$t, $select]);
        $data = $select->find();
        return $data;
    }
118220
public Record getNextGridRecord(boolean bFirstTime) throws DBException
    {
        Record record = this.getMainRecord();
        BaseTable table = record.getTable();
        if (bFirstTime)
            table.close();
        boolean bHasNext = table.hasNext();
        if (!bHasNext)
            return null;
        return (Record)table.next();
    }
150113
public Constant getVal(String fldName) {
		int position = fieldPos(fldName);
		return getVal(position, ti.schema().type(fldName));
	}
29703
public Object get(String strParam)
    {
        Object objValue = super.get(strParam);
        if (objValue == null)
            if (MessageConstants.MESSAGE_TYPE_PARAM.equals(strParam))
                objValue = Integer.toString(((RecordMessageHeader)this.getMessageHeader()).getRecordMessageType());
        return objValue;
    }
356689
public Record openHeaderRecord()
    {
        Record record = null;
        this.syncContactTypeToMain();    // Read in the current contact record
        ReferenceField fldContactType = (ReferenceField)this.getMainRecord().getField(MessageDetail.CONTACT_TYPE_ID);
        ContactType recContactType = (ContactType)fldContactType.getReferenceRecord(this);
        recContactType = (ContactType)fldContactType.getReference(); // Being careful
        String strHeaderRecordName = null;
        if (recContactType != null)
            strHeaderRecordName = recContactType.getField(ContactType.CODE).toString();
        if ((strHeaderRecordName == null) || (strHeaderRecordName.length() == 0))
            strHeaderRecordName = this.getProperty(fldContactType.getFieldName());
        record = recContactType.makeRecordFromRecordName(strHeaderRecordName, this);
        if (record != null)
                ((ReferenceField)this.getMainRecord().getField(MessageDetail.PERSON_ID)).setReferenceRecord(record);
        return record;
    }
1213780
byte[] getFirstKey(TableKelp table)
  {
    int keyOffset = table.getKeyOffset();
    int keyLength = table.getKeyLength();
    
    int offset = _rowHead + keyOffset;
    
    byte []key = new byte[keyLength];
    byte []buffer = getBuffer();
    
    System.arraycopy(buffer, offset, key, 0, keyLength);
    
    return key;
  }
975401
public static Record getRecordFromCode(BaseField field, String strDesc, String strFieldName)
    {
        Record recSecond = ((ReferenceField)field).getReferenceRecord();
        return BaseFixData.getRecordFromCode(field, strDesc, strFieldName, recSecond);
    }
156114
public EntryRecord getRecord(Object key, byte[] serializedKey) throws IOException {
      int segment = (key.hashCode() & Integer.MAX_VALUE) % segments.length;
      lock.readLock().lock();
      try {
         return IndexNode.applyOnLeaf(segments[segment], serializedKey, segments[segment].rootReadLock(), IndexNode.ReadOperation.GET_RECORD);
      } finally {
         lock.readLock().unlock();
      }
   }
787578
public Record openMainRecord()
    {
        String strRecord = this.getProperty(DBParams.RECORD);
        String strPackage = this.getProperty("package");
        if ((strRecord == null) || (strPackage == null))
            return null;
        if (strPackage.startsWith("."))
            strPackage = DBConstants.ROOT_PACKAGE.substring(0, DBConstants.ROOT_PACKAGE.length() - 1) + strPackage;   // Never
        String strRecordClassName = strPackage + '.' + strRecord;
        String oldBaseTableProperty = this.getTask().getApplication().getProperty(DBConstants.BASE_TABLE_ONLY);
        this.getTask().getApplication().setProperty(DBConstants.BASE_TABLE_ONLY, DBConstants.TRUE);
        Record record = Record.makeRecordFromClassName(strRecordClassName, this);
        record.setEnableListeners(false);
        record.setEnableFieldListeners(false);
        // Restore properties
        this.getTask().getApplication().setProperty(DBConstants.BASE_TABLE_ONLY, oldBaseTableProperty);   // Make sure system record owner property is reset also
        return record;
    }
52642
public boolean seek(String strSeekSign) throws DBException
    {
        boolean bSuccess = false;
        BaseTable table = this.getCurrentTable();
        if (table != null)
        {
            table.getRecord().setKeyArea(this.getRecord().getDefaultOrder());
            bSuccess = table.seek(strSeekSign);
            if (bSuccess)    // Move to first record
                this.setCurrentTable(table);
        }
        this.syncCurrentToBase();
        return bSuccess;
    }
906201
public Record getReferenceRecord()
    {
        Record recordReference = this.getReferenceRecord(null);
        if (recordReference != null)
        	if (recordReference.getRecordOwner() == null)	// Only add it if it doesn't belong to any other screen.
        {
            RecordOwner recordOwner = null;
            if (this.getRecord() != null)
                recordOwner = Record.findRecordOwner(this.getRecord());
            if (recordOwner != null)
                recordOwner.addRecord(recordReference, false);
            if (this.getRecord() != null)
            {   // Make sure record is freed when this record is freed.
                FreeOnFreeHandler listener = (FreeOnFreeHandler)this.getRecord().getListener(FreeOnFreeHandler.class);
                while (listener != null)
                {
                    if (listener.getDependentObject() == recordReference)
                        break;  // listener is already there
                    listener = (FreeOnFreeHandler)listener.getListener(FreeOnFreeHandler.class);
                }
                if (listener == null)
                    this.getRecord().addListener(new FreeOnFreeHandler(recordReference));
            }
        }
        return recordReference;
    }
794008
public Record getRecord(String strFileName)
    {
        Record record = null;
        if (m_vRecordList != null)
            record = m_vRecordList.getRecord(strFileName);
        if (record == null)
            if (m_taskParent instanceof RecordOwner)
                record = (Record)((RecordOwner)m_taskParent).getRecord(strFileName); // Look thru the parent window now
        return record;  // Look thru the parent window now
    }
163546
public boolean seek(String strSeekSign) throws DBException
    {
        // NOTE: This extra logic deals with a very specific and obscure case:
        // If this GRID table is NOT currently being used for indexed access (ie., get(x))
        // You can do a seek and I will cache the record. On a subsequent seek, I will return the cached
        // record. This is typically used for thin client accessing cached virtual fields in a table session.
        boolean bAutonomousSeek = false;
        if (m_iEndOfFileIndex == UNKNOWN_POSITION)
            if ((m_iPhysicalFilePosition == UNKNOWN_POSITION) || (m_iPhysicalFilePosition == ADD_NEW_POSITION))
                if ((m_iLogicalFilePosition == UNKNOWN_POSITION) || (m_iLogicalFilePosition == ADD_NEW_POSITION))
                    bAutonomousSeek = true;
        if (bAutonomousSeek)
        {
            Object bookmark = this.getRecord().getHandle(DBConstants.BOOKMARK_HANDLE);
            int iPosition = this.findElement(bookmark, DBConstants.BOOKMARK_HANDLE);
            if (iPosition == 0)
            {
                DataRecord dataRecord = (DataRecord)this.elementAt(iPosition);
                return this.getNextTable().setDataRecord(dataRecord);    // Success always.
            }
        }
    //  Don't set m_iPhysicalFilePosition = UNKNOWN_POSITION, because tables use seek to do queries.
        boolean bSuccess = super.seek(strSeekSign);
        if (bAutonomousSeek)
        {
            if (bSuccess)
                this.addRecordReference(0);
        }
        return bSuccess;
    }
489348
public int lockCurrentRecord() throws DBException
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        Record record = this.getRecord();
        Object bookmark = record.getHandle(DBConstants.BOOKMARK_HANDLE);
        if (bookmark != null)
        {   // Always
            String strUserName = null;
            BaseApplication app = null;
            org.jbundle.model.Task task = null;
            if (record.getRecordOwner() != null)
                task = record.getRecordOwner().getTask();
            if (task != null)
                app = (BaseApplication)record.getRecordOwner().getTask().getApplication();
            if (app != null)
                strUserName = app.getProperty(DBParams.USER_NAME);
            Environment env = null;
            if (app != null)
                env = app.getEnvironment();
            else
                env = Environment.getEnvironment(null);
            iErrorCode = env.getLockManager().lockThisRecord(task, record.getDatabaseName(), record.getTableNames(false), bookmark, strUserName, record.getOpenMode());
        }
        return iErrorCode;
    }