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> TBase.doInTransaction(DB.ThrowingSupplier<T> bodyHandler, Consumer<Exception> exceptionHandler, Runnable finallyHandler)Same asDB.doInTransaction(DB.ThrowingSupplier, Consumer, Runnable), but with db nameDB.DEFAULT_NAME.<T> TDB.doInTransaction(DB.ThrowingSupplier<T> bodyHandler, Consumer<Exception> exceptionHandler, Runnable finallyHandler)Executes a specified code block in a transaction and returns a result.static <T> TBase.doInTransactionSilently(DB.ThrowingSupplier<T> bodyHandler, Function<Exception,T> exceptionHandler)Same asDB.doInTransactionSilently(DB.ThrowingSupplier, Function), but with db nameDB.DEFAULT_NAME.<T> TDB.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.bodyHandleris executed. IfbodyHandlerexecution completed without exception, transaction is committed and result is returned. IfbodyHandlerexecution throws some exception: Transaction is rolled-back.exceptionHandleris invoked with the exception as parameter, and its output returned as result Finally, connection auto-commit flag set to true. Usage example: