public interface JanusGraphTransaction extends Transaction
JanusGraph
. Since JanusGraph is a transactional graph
database, all interactions with the graph are mitigated by a JanusGraphTransaction.
All vertex and edge retrievals are channeled by a graph transaction which bundles all such retrievals, creations and
deletions into one transaction. A graph transaction is analogous to a
database transaction.
The isolation level and ACID support are configured through the storage
backend, meaning whatever level of isolation is supported by the storage backend is mirrored by a graph transaction.
A graph transaction supports:
org.apache.tinkerpop.gremlin.structure.Graph.Exceptions, org.apache.tinkerpop.gremlin.structure.Graph.Features, org.apache.tinkerpop.gremlin.structure.Graph.Hidden, org.apache.tinkerpop.gremlin.structure.Graph.OptIn, org.apache.tinkerpop.gremlin.structure.Graph.OptIns, org.apache.tinkerpop.gremlin.structure.Graph.OptOut, org.apache.tinkerpop.gremlin.structure.Graph.OptOuts, org.apache.tinkerpop.gremlin.structure.Graph.Variables
Modifier and Type | Method and Description |
---|---|
JanusGraphVertex |
addVertex(Long id,
VertexLabel vertexLabel)
Creates a new vertex in the graph with the given vertex id and the given vertex label.
|
void |
commit()
Commits and closes the transaction.
|
Iterable<JanusGraphEdge> |
getEdges(RelationIdentifier... ids) |
JanusGraphVertex |
getVertex(long id)
Retrieves the vertex for the specified id.
|
Iterable<JanusGraphVertex> |
getVertices(long... ids) |
boolean |
hasModifications()
Checks whether any changes to the graph database have been made in this transaction.
|
boolean |
isClosed()
Checks whether the transaction has been closed.
|
boolean |
isOpen()
Checks whether the transaction is still open.
|
void |
rollback()
Aborts and closes the transaction.
|
addVertex, addVertex, close, indexQuery, multiQuery, multiQuery, query
compute, compute, configuration, edges, features, io, traversal, traversal, traversal, tx, variables, vertices
makeEdgeLabel, makePropertyKey, makeVertexLabel
containsEdgeLabel, containsPropertyKey, containsRelationType, containsVertexLabel, getEdgeLabel, getOrCreateEdgeLabel, getOrCreatePropertyKey, getOrCreateVertexLabel, getPropertyKey, getRelationType, getVertexLabel
JanusGraphVertex addVertex(Long id, VertexLabel vertexLabel)
GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID
.
Use JanusGraphId.toVertexId(long)
to construct a valid JanusGraph vertex id from a user id.id
- vertex id of the vertex to be createdvertexLabel
- vertex label for this vertex - can be null if no vertex label should be set.JanusGraphVertex getVertex(long id)
Graph.vertices(Object...)
instead.id
- id of the vertex to retrieveIterable<JanusGraphVertex> getVertices(long... ids)
Iterable<JanusGraphEdge> getEdges(RelationIdentifier... ids)
void commit()
BackendException
- if an error arises during persistencevoid rollback()
BackendException
- if an error arises when releasing the transaction handleboolean isOpen()
boolean isClosed()
boolean hasModifications()
Copyright © 2012–2017. All rights reserved.