Class DefaultTransactionManager
java.lang.Object
org.neo4j.ogm.session.transaction.DefaultTransactionManager
- All Implemented Interfaces:
org.neo4j.ogm.transaction.TransactionManager
public class DefaultTransactionManager
extends Object
implements org.neo4j.ogm.transaction.TransactionManager
- Author:
- Vince Bickers, Luanne Misquitta, Michael J. Simons
-
Constructor Summary
ConstructorDescriptionDefaultTransactionManager
(Session session, Function<org.neo4j.ogm.transaction.TransactionManager, BiFunction<org.neo4j.ogm.transaction.Transaction.Type, Iterable<String>, org.neo4j.ogm.transaction.Transaction>> transactionFactorySupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
void
commit
(org.neo4j.ogm.transaction.Transaction transaction) Commits the specified transaction.org.neo4j.ogm.transaction.Transaction
Returns the current transaction for this thread, or null if none existsorg.neo4j.ogm.transaction.Transaction
Opens a new transaction against a database instance.org.neo4j.ogm.transaction.Transaction
openTransaction
(org.neo4j.ogm.transaction.Transaction.Type type, Iterable<String> bookmarks) Opens a new transaction against a database instance.void
rollback
(org.neo4j.ogm.transaction.Transaction transaction) Rolls back the specified transaction.
-
Constructor Details
-
DefaultTransactionManager
public DefaultTransactionManager(Session session, Function<org.neo4j.ogm.transaction.TransactionManager, BiFunction<org.neo4j.ogm.transaction.Transaction.Type, Iterable<String>, org.neo4j.ogm.transaction.Transaction>> transactionFactorySupplier)
-
-
Method Details
-
openTransaction
public org.neo4j.ogm.transaction.Transaction openTransaction()Opens a new transaction against a database instance. Instantiation of the transaction is left to the driver- Specified by:
openTransaction
in interfaceorg.neo4j.ogm.transaction.TransactionManager
- Returns:
- a new
Transaction
-
openTransaction
public org.neo4j.ogm.transaction.Transaction openTransaction(org.neo4j.ogm.transaction.Transaction.Type type, Iterable<String> bookmarks) Opens a new transaction against a database instance. Instantiation of the transaction is left to the driver- Specified by:
openTransaction
in interfaceorg.neo4j.ogm.transaction.TransactionManager
- Returns:
- a new
Transaction
-
rollback
public void rollback(org.neo4j.ogm.transaction.Transaction transaction) Rolls back the specified transaction. The actual job of rolling back the transaction is left to the relevant driver. if this is successful, the transaction is detached from this thread. Any new objects are reset in the session, so that their ids are reset to null. If the specified transaction is not the correct one for this thread, throws an exception- Specified by:
rollback
in interfaceorg.neo4j.ogm.transaction.TransactionManager
- Parameters:
transaction
- the transaction to rollback
-
commit
public void commit(org.neo4j.ogm.transaction.Transaction transaction) Commits the specified transaction. The actual job of committing the transaction is left to the relevant driver. if this is successful, the transaction is detached from this thread. If the specified transaction is not the correct one for this thread, throws an exception- Specified by:
commit
in interfaceorg.neo4j.ogm.transaction.TransactionManager
- Parameters:
transaction
- the transaction to commit
-
getCurrentTransaction
public org.neo4j.ogm.transaction.Transaction getCurrentTransaction()Returns the current transaction for this thread, or null if none exists- Specified by:
getCurrentTransaction
in interfaceorg.neo4j.ogm.transaction.TransactionManager
- Returns:
- this thread's transaction
-
canCommit
public boolean canCommit()- Specified by:
canCommit
in interfaceorg.neo4j.ogm.transaction.TransactionManager
-
canRollback
public boolean canRollback()- Specified by:
canRollback
in interfaceorg.neo4j.ogm.transaction.TransactionManager
-
bookmark
- Specified by:
bookmark
in interfaceorg.neo4j.ogm.transaction.TransactionManager
-