Package com.orientechnologies.orient.core.exception

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


  }

  @Override
  protected void checkOpeness() {
    if (ownerPool == null)
      throw new ODatabaseException(
          "Database instance has been released to the pool. Get another database instance from the pool with the right username and password");

    super.checkOpeness();
  }
View Full Code Here


    return new ORecordId(clusterId, clusterPosition);
  }

  private void checkClusterLimits() {
    if (clusterId < -1)
      throw new ODatabaseException("RecordId can't support negative cluster id. You've used: " + clusterId);

    if (clusterId > CLUSTER_MAX)
      throw new ODatabaseException("RecordId can't support cluster id major than 32767. You've used: " + clusterId);
  }
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);

    } 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

          break;
        case LINK:
          out.writeBoolean(value != null);
          if (value != null) {
            if (!(value instanceof ORecord<?>))
              throw new ODatabaseException("Invalid property value in '" + p.getName() + "': found " + value.getClass()
                  + " while it was expected a ORecord");

            ORID rid = ((ORecord<?>) value).getIdentity();
            out.writeInt(rid.getClusterId());
            out.writeLong(rid.getClusterPosition());
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

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.