code: public int doEdit() throws DBException
      {
          Record record = this.getRecord();
          if (record.getKeyArea(0) != null)
          {   // Record was set up using a cached copy, restore the primary key so you can update it!
              KeyArea keyArea = record.getKeyArea(0); // Primary index
              keyArea.setupKeyBuffer(null, DBConstants.TEMP_KEY_AREA);        // Save keys for possible update/delete
          }
          if (this.lockOnDBTrxType(null, DBConstants.LOCK_TYPE, true))
              return this.lockCurrentRecord();
          else
              return DBConstants.NORMAL_RETURN;
      }
docs: Lock the current record.
  This method responds differently depending on what open mode the record is in:
  OPEN_DONT_LOCK - A physical lock is not done. This is usually where deadlocks are possible
  (such as screens) and where transactions are in use (and locks are not needed).
  OPEN_LOCK_ON_EDIT - Holds a lock until an update or close. (Update crucial data, or hold records for processing)
  Returns false is someone already has a lock on this record.
  OPEN_WAIT_FOR_LOCK - Don't return from edit until you get a lock. (ie., Add to the total).
  Returns false if someone has a hard lock or time runs out.
  @return true if successful, false is lock failed.
  @exception DBException FILE_NOT_OPEN
  @exception DBException INVALID_RECORD - Record not current.