Uses of Interface
org.javalite.activejdbc.DB.ThrowingSupplier
Packages that use DB.ThrowingSupplier
-
Uses of DB.ThrowingSupplier in org.javalite.activejdbc
Methods in org.javalite.activejdbc with parameters of type DB.ThrowingSupplierModifier and TypeMethodDescriptionstatic <T> T
Base.doInTransaction(DB.ThrowingSupplier<T> bodyHandler, Consumer<Exception> exceptionHandler, Runnable finallyHandler)
Same asDB.doInTransaction(DB.ThrowingSupplier, Consumer, Runnable)
, but with db nameDB.DEFAULT_NAME
.<T> T
DB.doInTransaction(DB.ThrowingSupplier<T> bodyHandler, Consumer<Exception> exceptionHandler, Runnable finallyHandler)
Executes a specified code block in a transaction and returns a result.static <T> T
Base.doInTransactionSilently(DB.ThrowingSupplier<T> bodyHandler, Function<Exception,T> exceptionHandler)
Same asDB.doInTransactionSilently(DB.ThrowingSupplier, Function)
, but with db nameDB.DEFAULT_NAME
.<T> T
DB.doInTransactionSilently(DB.ThrowingSupplier<T> bodyHandler, Function<Exception,T> exceptionHandler)
Executes specified code in transaction and returns its result without throwing exceptions.
Usage: Transaction is opened in current (thread-bound) connection.bodyHandler
is executed. IfbodyHandler
execution completed without exception, transaction is committed and result is returned. IfbodyHandler
execution throws some exception: Transaction is rolled-back.exceptionHandler
is invoked with the exception as parameter, and its output returned as result Finally, connection auto-commit flag set to true. Usage example: