Class GraphTransactionUtil
java.lang.Object
org.eclipse.jnosql.databases.tinkerpop.communication.GraphTransactionUtil
Utility class providing methods to manage transactions in a graph database.
This class offers functionality to lock and unlock transactions, as well as automatic transaction management.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if automatic transaction management is enabled.static voidlock(org.apache.tinkerpop.gremlin.structure.Transaction transaction) Locks the current transaction, preventing it from being committed.static voidtransaction(org.apache.tinkerpop.gremlin.structure.Graph graph) Automatically commits a transaction if enabled and not locked.static voidunlock()Unlocks the current transaction.
-
Method Details
-
lock
public static void lock(org.apache.tinkerpop.gremlin.structure.Transaction transaction) Locks the current transaction, preventing it from being committed.- Parameters:
transaction- the transaction to lock
-
unlock
public static void unlock()Unlocks the current transaction. Allows the transaction to be committed. -
transaction
public static void transaction(org.apache.tinkerpop.gremlin.structure.Graph graph) Automatically commits a transaction if enabled and not locked.- Parameters:
graph- the graph instance
-
isAutomatic
public static boolean isAutomatic()Checks if automatic transaction management is enabled.- Returns:
- true if automatic transaction management is enabled, false otherwise
-