code: public ODatabaseDocumentTx delete(final ODocument iRecord) {
      if (iRecord == null)
        throw new ODatabaseException("Cannot delete null document");
  
      // CHECK ACCESS ON SCHEMA CLASS NAME (IF ANY)
      if (iRecord.getClassName() != null)
        checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_DELETE, iRecord.getClassName());
  
      try {
        underlying.delete(iRecord);
  
      } catch (Exception e) {
        OLogManager.instance().exception("Error on deleting record %s of class '%s'", e, ODatabaseException.class,
            iRecord.getIdentity(), iRecord.getClassName());
      }
      return this;
    }
docs: Deletes a document. Behavior depends by the current running transaction if any. If no transaction is running then the record is
  deleted immediately. If an Optimistic transaction is running then the record will be deleted at commit time. The current
  transaction will continue to see the record as deleted, while others not. If a Pessimistic transaction is running, then an
  exclusive lock is acquired against the record. Current transaction will continue to see the record as deleted, while others
  cannot access to it since it's locked.
  <p/>
  If MVCC is enabled and the version of the document is different by the version stored in the database, then a
  {@link OConcurrentModificationException} exception is thrown.
  
  @param iRecord
  @return The Database instance itself giving a "fluent interface". Useful to call multiple methods in chain.
  @see #setMVCC(boolean), {@link #isMVCC()}