public void delete(int recNo) throws RecordNotFoundException, DatabaseException {
        logger.entering("DataDBAccess", "delete", recNo);
        synchronized (mutex) {
            final Long lockCookie = Thread.currentThread().getId();
            Long ownerCookieValue = locker.getOwner(recNo);
            if (recNo < 0) {
                throw new RecordNotFoundException("Record not found for record"
                        + " number: " + recNo);
            }
            if (ownerCookieValue == null) {
                throw new DatabaseException("Record is not locked: " + recNo);
            }

            if (ownerCookieValue.equals(lockCookie)) {
                try {
                    fileObject.seek(offset + recNo * maxRecord);
                    byte[] record = new byte[maxRecord];
                    int tempRecordLength = fileObject.read(record);
                    if (tempRecordLength != maxRecord) {
                        throw new RecordNotFoundException("Record not found or record size does not match");
                    }
                    if (record[0] == DELETED) {
                        throw new RecordNotFoundException
                                ("The record " + recNo + " has already been deleted" );
                    }
                    fileObject.seek(offset + recNo * maxRecord);
                    fileObject.writeByte(DELETED);
                } catch (Exception e) {
                    throw new RecordNotFoundException("The record: " + recNo 
                        + " was not found, " + e.getMessage());
                }
            }
            else {
                throw new DatabaseException("Record already locked by another"
                        + " client: " + recNo);
            }
        }
        logger.exiting("DataDBAccess", "delete");
    }