public interface TitanTransaction extends TitanGraphTransaction
TitanGraph. Since TitanGraph is a transactional graph
database, all interactions with the graph are mitigated by a TitanTransaction.
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 |
|---|---|
TitanVertex |
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<TitanEdge> |
getEdges(RelationIdentifier... ids) |
TitanVertex |
getVertex(long id)
Retrieves the vertex for the specified id.
|
Iterable<TitanVertex> |
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, querycompute, compute, configuration, edges, features, io, traversal, traversal, tx, variables, verticesmakeEdgeLabel, makePropertyKey, makeVertexLabelcontainsEdgeLabel, containsPropertyKey, containsRelationType, containsVertexLabel, getEdgeLabel, getOrCreateEdgeLabel, getOrCreatePropertyKey, getOrCreateVertexLabel, getPropertyKey, getRelationType, getVertexLabelTitanVertex addVertex(Long id, VertexLabel vertexLabel)
GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID.
Use TitanId.toVertexId(long) to construct a valid Titan 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.TitanVertex getVertex(long id)
Graph.vertices(Object...) instead.id - id of the vertex to retrieveIterable<TitanVertex> getVertices(long... ids)
Iterable<TitanEdge> 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–2015. All rights reserved.