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

public final class DefaultTransactionManager extends AbstractTransactionManager
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

    Constructors
    Constructor
    Description
    DefaultTransactionManager(org.neo4j.ogm.driver.Driver driver, Session session)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.neo4j.ogm.transaction.Transaction
    Returns the current transaction for this thread, or null if none exists
    protected 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 the opener or passes a current transaction to the extender.
    protected void
    removeIfCurrent(org.neo4j.ogm.transaction.Transaction transaction, Runnable action)
    Check if transaction 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultTransactionManager

      public DefaultTransactionManager(org.neo4j.ogm.driver.Driver driver, Session session)
  • 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 the opener or passes a current transaction to the extender. The latter will try to extend the transaction if it's compatible.
      Specified by:
      openOrExtend in class AbstractTransactionManager
      Parameters:
      opener - The opener of new transaction
      extender - The extender trying to create sub transactions
      Returns:
      The new current transaction
    • removeIfCurrent

      protected void removeIfCurrent(org.neo4j.ogm.transaction.Transaction transaction, Runnable action)
      Description copied from class: AbstractTransactionManager
      Check if transaction is the transaction belonging to this thread, if so, calls the action and then detach the transaction from the thread.
      Specified by:
      removeIfCurrent in class AbstractTransactionManager
      action - The action to be run prior to detaching / unlocking the transaction from the thread.