Class DefaultTransactionManager
java.lang.Object
org.neo4j.ogm.session.transaction.AbstractTransactionManager
org.neo4j.ogm.session.transaction.DefaultTransactionManager
- All Implemented Interfaces:
org.neo4j.ogm.transaction.TransactionManager
- Author:
- Vince Bickers, Luanne Misquitta, Michael J. Simons
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.neo4j.ogm.transaction.TransactionManager
org.neo4j.ogm.transaction.TransactionManager.TransactionClosedListener
-
Constructor Summary
ConstructorDescriptionDefaultTransactionManager
(org.neo4j.ogm.driver.Driver driver, Session session) -
Method Summary
Modifier and TypeMethodDescriptionorg.neo4j.ogm.transaction.Transaction
Returns the current transaction for this thread, or null if none existsprotected org.neo4j.ogm.transaction.Transaction
openOrExtend
(Supplier<org.neo4j.ogm.transaction.Transaction> opener, UnaryOperator<org.neo4j.ogm.transaction.Transaction> extender) Opens a new transaction if there is no current via theopener
or passes a current transaction to theextender
.protected void
removeIfCurrent
(org.neo4j.ogm.transaction.Transaction transaction, Runnable action) Check iftransaction
is the transaction belonging to this thread, if so, calls the action and then detach the transaction from the thread.Methods inherited from class org.neo4j.ogm.session.transaction.AbstractTransactionManager
bookmark, close, openTransaction, openTransaction
-
Constructor Details
-
DefaultTransactionManager
-
-
Method Details
-
getCurrentTransaction
public org.neo4j.ogm.transaction.Transaction getCurrentTransaction()Returns the current transaction for this thread, or null if none exists- Returns:
- this thread's transaction
-
openOrExtend
protected org.neo4j.ogm.transaction.Transaction openOrExtend(Supplier<org.neo4j.ogm.transaction.Transaction> opener, UnaryOperator<org.neo4j.ogm.transaction.Transaction> extender) Description copied from class:AbstractTransactionManager
Opens a new transaction if there is no current via theopener
or passes a current transaction to theextender
. The latter will try to extend the transaction if it's compatible.- Specified by:
openOrExtend
in classAbstractTransactionManager
- Parameters:
opener
- The opener of new transactionextender
- The extender trying to create sub transactions- Returns:
- The new current transaction
-
removeIfCurrent
Description copied from class:AbstractTransactionManager
Check iftransaction
is the transaction belonging to this thread, if so, calls the action and then detach the transaction from the thread.- Specified by:
removeIfCurrent
in classAbstractTransactionManager
action
- The action to be run prior to detaching / unlocking the transaction from the thread.
-