Package com.orientechnologies.orient.core.exception

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


      for (ORecord<?> record : updatedRecords.values())
        unmarshallRecord(record);

    } catch (IOException e) {
      rollback();
      throw new OSerializationException("Can't read transaction record from the network. Transaction aborted", e);
    }
  }
View Full Code Here


   * @param iValue
   */
  public StringBuilder toStream(final ODatabaseComplex<?> iDatabase, final StringBuilder iOutput, Object iValue) {
    if (iValue != null) {
      if (!(iValue instanceof OSerializableStream))
        throw new OSerializationException("Can't serialize the object since it's not implements the OSerializableStream interface");

      OSerializableStream stream = (OSerializableStream) iValue;
      iOutput.append(iValue.getClass().getName());
      iOutput.append(OStreamSerializerHelper.SEPARATOR);
      iOutput.append(OBinaryProtocol.bytes2string(stream.toStream()));
View Full Code Here

        if (c == COLLECTION_BEGIN)
          insideCollection++;
        else if (c == COLLECTION_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideCollection == 0)
              throw new OSerializationException("Found invalid " + COLLECTION_END
                  + " character. Assure to open and close correctly.");
            insideCollection--;
          }

        } else if (c == PARENTHESIS_BEGIN) {
          insideParenthesis++;
        } else if (c == PARENTHESIS_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideParenthesis == 0)
              throw new OSerializationException("Found invalid " + PARENTHESIS_END
                  + " character. Assure to open and close correctly.");
            insideParenthesis--;
          }

        } else if (c == MAP_BEGIN) {
          insideMap++;
        } else if (c == MAP_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideMap == 0)
              throw new OSerializationException("Found invalid " + MAP_END + " character. Assure to open and close correctly.");
            insideMap--;
          }
        }

        else if (c == LINK)
View Full Code Here

  public byte[] toStream(final ODatabaseRecord iDatabase, final Object iObject) throws IOException {
    if (iObject == null)
      return null;

    if (((ORecord<?>) iObject).getIdentity() == null)
      throw new OSerializationException("Can't serialize record without identity. Store it before to serialize.");

    return ((ORecord<?>) iObject).getIdentity().toStream();
  }
View Full Code Here

        else
          // DETERMINE TYPE BY REFLECTION
          type = getFieldType(iUserObject, iFieldName);

        if (type == null)
          throw new OSerializationException(
              "Linked type of field '"
                  + iRoot.getClassName()
                  + "."
                  + iFieldName
                  + "' is unknown. Probably needs to be registered with <db>.getEntityManager().registerEntityClasses(<package>) or <db>.getEntityManager().registerEntityClass(<class>) or the package can't be loaded correctly due to a classpath problem. In this case register the single classes one by one.");
View Full Code Here

//            db.getUnderlying().save(linkedDocument);
//          }
          iObj2RecHandler.registerUserObject(pojo, linkedDocument);

        } else
          throw new OSerializationException("Linked type [" + iFieldValue.getClass() + ":" + iFieldValue
              + "] can't be serialized because is not part of registered entities. To fix this error register this class");
      }
    }
    return iFieldValue;
  }
View Full Code Here

      // VALUES WILL BE LOADED LAZY
      values = (V[]) new Object[pageSize];

      return this;
    } catch (IOException e) {
      throw new OSerializationException("Can't unmarshall RB+Tree node", e);
    } finally {
      OProfiler.getInstance().stopChrono("OMVRBTreeEntryP.fromStream", timer);
    }
  }
View Full Code Here

      record.fromStream(buffer);
      return buffer;

    } catch (IOException e) {
      throw new OSerializationException("Can't marshall RB+Tree node", e);
    } finally {
      marshalledRecords.remove(identityRecord);

      checkEntryStructure();
View Full Code Here

      byte protocolVersion = stream.peek();
      if (protocolVersion != -1) {
        // @COMPATIBILITY BEFORE 0.9.25
        stream.getAsByte();
        if (protocolVersion != CURRENT_PROTOCOL_VERSION)
          throw new OSerializationException(
              "The index has been created with a previous version of OrientDB. Soft transitions between version is a featured supported since 0.9.25. In order to use it with this version of OrientDB you need to export and import your database. "
                  + protocolVersion + "<->" + CURRENT_PROTOCOL_VERSION);
      }

      rootRid.fromStream(stream.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
View Full Code Here

      record.fromStream(stream.getByteArray());
      return record.toStream();

    } catch (IOException e) {
      throw new OSerializationException("Error on marshalling RB+Tree", e);
    } finally {
      marshalledRecords.remove(identityRecord);

      OProfiler.getInstance().stopChrono("OMVRBTreePersistent.toStream", timer);
    }
View Full Code Here

TOP

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

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.