Interface Transactional
-
- All Known Implementing Classes:
DatabaseService
public interface TransactionalThe transactional access definition.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CloseableTransactiongetCloseableTransaction()Creates a closeable transaction for undefined lifetime.voidwithTransaction(Consumer<QueryDefFactory> block)Creates a transaction for the lifetime of a code block.<T> TwithTransaction(Function<QueryDefFactory,T> block)Creates a transaction for the lifetime of a code block.
-
-
-
Method Detail
-
withTransaction
<T> T withTransaction(Function<QueryDefFactory,T> block)
Creates a transaction for the lifetime of a code block.- Parameters:
block- the code block- Returns:
- the return value of the code block
-
withTransaction
void withTransaction(Consumer<QueryDefFactory> block)
Creates a transaction for the lifetime of a code block.- Parameters:
block- the code block
-
getCloseableTransaction
CloseableTransaction getCloseableTransaction()
Creates a closeable transaction for undefined lifetime.- Returns:
- the closeable transaction
-
-