Skip to content

OrientDB Implementation

lvca edited this page Aug 29, 2012 · 12 revisions

<dependency>
   <groupId>com.tinkerpop.blueprints</groupId>
   <artifactId>blueprints-orient-graph</artifactId>
   <version>??</version>
</dependency>
Graph graph = new OrientGraph("local:/tmp/orient");

Orient Technologies are the developers of OrientDB.

OrientGraph Feature List

supportsDuplicateEdges: true
supportsSelfLoops: true
supportsSerializableObjectProperty: true
supportsBooleanProperty: true
supportsDoubleProperty: true
supportsFloatProperty: true
supportsIntegerProperty: true
supportsPrimitiveArrayProperty: true
supportsUniformListProperty: true
supportsMixedListProperty: true
supportsLongProperty: true
supportsMapProperty: true
supportsStringProperty: true
ignoresSuppliedIds: true
isPersistent: true
isRDFModel: false
isWrapper: false
supportsIndices: true
supportsVertexIndex: true
supportsEdgeIndex: true
supportsKeyIndices: true
supportsVertexKeyIndex: true
supportsEdgeKeyIndex: true
supportsEdgeIteration: true
supportsVertexIteration: true
supportsTransactions: true
supportsThreadedTransactions: false

Notes on Caching and Concurrency

By default, OrientDB keeps a per-database instance cache of vertices and their properties. This can cause issues with concurrent access to the database where different threads will receive inconsistent results when querying the database after writes.

A way around this is to disable OrientDB’s L1 cache. This option can slow performance when doing certain graph operations. You can do this in code, before you create your graph with:

OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false);

A more fine grained option is to have Orient force reload vertices when appropriate using ODocument’s reload() command:

((ODocument)((OrientVertex)vertex).getRawElement()).reload();

Custom Types

OrientDB supports custom types for vertices and edges in an Object Oriented manner. Even if this isn’t supported directly by Blueprints there are some tricks to use them. For more information look at Custom types.