Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.ODatabaseException


    return connection.database;
  }

  protected void createDatabase(final ODatabaseDocumentTx iDatabase, String dbUser, String dbPasswd) {
    if (iDatabase.exists())
      throw new ODatabaseException("Database '" + iDatabase.getURL() + "' already exists");

    for (OStorage stg : Orient.instance().getStorages()) {
      if (stg.getName().equalsIgnoreCase(iDatabase.getName()) && stg.exists())
        throw new ODatabaseException("Database '" + iDatabase.getURL() + "' already exists: " + stg);
    }

    iDatabase.create();
    if (dbUser != null) {
View Full Code Here


   * @param iIgnoreCache
   *          Ignore the cache or use it
   */
  public ODocument load(final String iFetchPlan, boolean iIgnoreCache) {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    Object result = null;
    try {
      result = _database.load(this, iFetchPlan, iIgnoreCache);
    } catch (Exception e) {
View Full Code Here

    return this;
  }

  public ORecordInternal<T> load() {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    if (!getIdentity().isValid())
      throw new ORecordNotFoundException("The record has no id, probably it's new or transient yet ");

    try {
View Full Code Here

    return reload(null, true);
  }

  public ORecordInternal<T> reload(final String iFetchPlan, final boolean iIgnoreCache) {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    if (!getIdentity().isValid())
      throw new ORecordNotFoundException("The record has no id, probably it's new or transient yet ");

    try {
View Full Code Here

    }
  }

  public ORecordAbstract<T> save() {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record. Create it using the <DB>.newInstance()");

    _database.save(this);

    return this;
  }
View Full Code Here

    return this;
  }

  public ORecordAbstract<T> save(final String iClusterName) {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record. Create it using the <DB>.newInstance()");

    _database.save(this, iClusterName);

    return this;
  }
View Full Code Here

    return this;
  }

  public ORecordAbstract<T> delete() {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    _database.delete(this);
    setDirty();
    return this;
  }
View Full Code Here

      return new long[] { 0l, iPosition };

    final int fileNum = (int) (iPosition / fileMaxSize);

    if (fileNum >= files.length)
      throw new ODatabaseException("Record position #" + iPosition + " was bound to file #" + fileNum
          + " that is out of limit (files range 0-" + (files.length - 1) + ")");

    final int fileRec = (int) (iPosition % fileMaxSize);

    if (fileRec >= files[fileNum].getFilledUpTo())
      throw new ODatabaseException("Record position #" + iPosition + " was bound to file #" + fileNum + " but the position #"
          + files[fileNum].getFilledUpTo() + " is out of file size");

    return new long[] { fileNum, fileRec };
  }
View Full Code Here

      total = new OPhysicalPosition(0, -1, (byte) 0);
      map.put(new Long(-1), total);
      storage = iStorage;

    } catch (Exception e) {
      throw new ODatabaseException("Error on creating internal map for logical cluster: " + iName, e);
    }
    map.save();
  }
View Full Code Here

      if (total == null) {
        total = new OPhysicalPosition(0, map.size(), (byte) 0);
        map.put(new Long(-1), total);
      }
    } catch (Exception e) {
      throw new ODatabaseException("Error on load internal map for logical cluster: " + name, e);
    }
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.ODatabaseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.