java.lang.Object
org.neo4j.ogm.transaction.AbstractTransaction
- All Implemented Interfaces:
AutoCloseable,Transaction
- Author:
- vince
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.neo4j.ogm.transaction.Transaction
Transaction.Status, Transaction.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTransaction(TransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIf this transaction can be committedfinal booleanIf this transaction can be rolled back.final voidclose()close this transaction.final voidcommit()commit a transaction that has pending writesprotected abstract voidcommit0()Native implementation of the commit logic for a specific implementation.voidextend(Transaction.Type otherType) Extends the current transaction.booleanObtains the read-only status of a transaction.voidregisterNew(Object persisted) final voidrollback()rollback a transaction that has pending writesprotected abstract voidNative implementation of the rollback logic for a specific implementation.final Transaction.Statusstatus()return the status of the current transactiontype()Returns type of the transaction - READ_ONLY / READ_WRITE The value corresponds to type returned byTransaction.isReadOnly()
-
Field Details
-
transactionManager
-
type
-
-
Constructor Details
-
AbstractTransaction
-
-
Method Details
-
rollback
public final void rollback()Description copied from interface:Transactionrollback a transaction that has pending writes- Specified by:
rollbackin interfaceTransaction
-
rollback0
protected abstract void rollback0()Native implementation of the rollback logic for a specific implementation. -
commit
public final void commit()Description copied from interface:Transactioncommit a transaction that has pending writes- Specified by:
commitin interfaceTransaction
-
commit0
protected abstract void commit0()Native implementation of the commit logic for a specific implementation. -
canCommit
public final boolean canCommit()Description copied from interface:TransactionIf this transaction can be committed- Specified by:
canCommitin interfaceTransaction- Returns:
- true if this transaction can be committed
-
canRollback
public final boolean canRollback()Description copied from interface:TransactionIf this transaction can be rolled back.- Specified by:
canRollbackin interfaceTransaction- Returns:
- true if this transaction can be rolled back
-
extend
Extends the current transaction.- Parameters:
otherType- type of the other transaction
-
status
Description copied from interface:Transactionreturn the status of the current transaction- Specified by:
statusin interfaceTransaction- Returns:
- the Status value associated with the current transaction
-
isReadOnly
public boolean isReadOnly()Description copied from interface:TransactionObtains the read-only status of a transaction. Transaction are read-write by default- Specified by:
isReadOnlyin interfaceTransaction- Returns:
- true if this is a read-only transaction, false otherwise
-
type
Description copied from interface:TransactionReturns type of the transaction - READ_ONLY / READ_WRITE The value corresponds to type returned byTransaction.isReadOnly()- Specified by:
typein interfaceTransaction- Returns:
- type of the transaction
-
close
public final void close()Description copied from interface:Transactionclose this transaction.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTransaction
-
registerNew
-