Class AbstractTransaction

java.lang.Object
org.neo4j.ogm.transaction.AbstractTransaction
All Implemented Interfaces:
AutoCloseable, Transaction

public abstract class AbstractTransaction extends Object implements Transaction
Author:
vince
  • Field Details

  • Constructor Details

    • AbstractTransaction

      protected AbstractTransaction(TransactionManager transactionManager)
  • Method Details

    • rollback

      public final void rollback()
      Description copied from interface: Transaction
      rollback a transaction that has pending writes
      Specified by:
      rollback in interface Transaction
    • rollback0

      protected abstract void rollback0()
      Native implementation of the rollback logic for a specific implementation.
    • commit

      public final void commit()
      Description copied from interface: Transaction
      commit a transaction that has pending writes
      Specified by:
      commit in interface Transaction
    • commit0

      protected abstract void commit0()
      Native implementation of the commit logic for a specific implementation.
    • canCommit

      public final boolean canCommit()
      Description copied from interface: Transaction
      If this transaction can be committed
      Specified by:
      canCommit in interface Transaction
      Returns:
      true if this transaction can be committed
    • canRollback

      public final boolean canRollback()
      Description copied from interface: Transaction
      If this transaction can be rolled back.
      Specified by:
      canRollback in interface Transaction
      Returns:
      true if this transaction can be rolled back
    • extend

      public void extend(Transaction.Type otherType)
      Extends the current transaction.
      Parameters:
      otherType - type of the other transaction
    • status

      public final Transaction.Status status()
      Description copied from interface: Transaction
      return the status of the current transaction
      Specified by:
      status in interface Transaction
      Returns:
      the Status value associated with the current transaction
    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: Transaction
      Obtains the read-only status of a transaction. Transaction are read-write by default
      Specified by:
      isReadOnly in interface Transaction
      Returns:
      true if this is a read-only transaction, false otherwise
    • type

      public Transaction.Type type()
      Description copied from interface: Transaction
      Returns type of the transaction - READ_ONLY / READ_WRITE The value corresponds to type returned by Transaction.isReadOnly()
      Specified by:
      type in interface Transaction
      Returns:
      type of the transaction
    • close

      public final void close()
      Description copied from interface: Transaction
      close this transaction.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Transaction
    • registerNew

      public void registerNew(Object persisted)