public interface TransactionManager
- Author:
- Vince Bickers, Mark Angrish
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA handler that can be called per entity during commit or rollback operations. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose(Transaction transaction, Consumer<TransactionManager.TransactionClosedListener> callback) Closes the specified transaction if it belongs to the current thread.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.
-
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}
-
close
void close(Transaction transaction, Consumer<TransactionManager.TransactionClosedListener> callback) Closes the specified transaction if it belongs to the current thread. After thecallbackhas successfully been called, the transaction will be detached from this transaction manager and the executing thread.The method must throw an exception if the
transactiondoes not belong to the current thread.- Parameters:
transaction- The transaction to be closedcallback- A callback to be executed prior to detaching the transaction from the thread.
-
getCurrentTransaction
Transaction getCurrentTransaction()Returns the current transaction for this thread, or null if none exists- Returns:
- this thread's transaction
-
bookmark
-