Package org.neo4j.ogm.transaction
Interface TransactionManager
public interface TransactionManager
- Author:
- Vince Bickers, Mark Angrish
-
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanvoidcommit(Transaction transaction) Commits the specified transaction.Returns the current transaction for this thread, or null if none existsOpens a new READ_WRITE transaction against a database instance.openTransaction(Transaction.Type type, Iterable<String> bookmarks) Opens a new transaction of the specified type against a database instance.voidrollback(Transaction transaction) Rolls back the specified transaction.
-
Method Details
-
openTransaction
Transaction openTransaction()Opens a new READ_WRITE transaction against a database instance. Instantiation of the transaction is left to the driver- Returns:
- a new @{link Transaction}
-
openTransaction
Opens a new transaction of the specified type against a database instance. Instantiation of the transaction is left to the driver- Parameters:
type- type of the transactionbookmarks- bookmarks to be passed to driver- Returns:
- a new @{link Transaction}
-
rollback
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. If the specified transaction is not the correct one for this thread, throws an exception Warning: This method is meant to be called from actual transactions only!!!- Parameters:
transaction- the transaction to rollback
-
commit
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 Warning: This method is meant to be called from actual transactions only!!!- Parameters:
transaction- the transaction to commit
-
getCurrentTransaction
Transaction getCurrentTransaction()Returns the current transaction for this thread, or null if none exists- Returns:
- this thread's transaction
-
canCommit
boolean canCommit() -
canRollback
boolean canRollback() -
bookmark
-