Class TransactionWrapper
java.lang.Object
com.suncode.pwfl.transaction.support.TransactionWrapper
Helper class to wrap functions in transaction.
- Author:
- RafaĆ Nowacki 2018-12-17
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescription<T> T
void
<T> T
Calls given function inside opened hibernate transaction and returns function result.void
Calls given function inside opened hibernate transaction.<T> T
doInJdbcConnection
(TransactionWrapper.JdbcCallable<T> callable) void
<T> T
Calls given function inside new hibernate transaction and returns function result.runnable.<T> T
doInNewHibernateTransaction
(TransactionWrapper.HibernateCallable<T> callable, boolean readOnly) Calls given function inside new hibernate transaction and returns function result.runnable.void
<T> T
doInSharkTransaction
(TransactionWrapper.SharkCallable<T> callable) Calls given function inside opened shark transaction and returns function result.<T> T
doInSharkTransaction
(TransactionWrapper.SharkCallable<T> callable, boolean readOnly) Calls given function inside opened shark transaction and returns function result.void
Calls given function inside opened shark transaction.void
doInSharkTransaction
(TransactionWrapper.SharkRunnable runnable, boolean readOnly) Calls given function inside opened shark transaction.void
doInSharkTransaction
(TransactionWrapper.SharkRunnable runnable, int propagationBehaviour) void
doInSharkTransaction
(TransactionWrapper.SharkRunnable runnable, int propagationBehaviour, boolean readOnly) <T> T
Calls given function inside opened hibernate transaction and returns function result.void
Calls given function inside opened hibernate transaction.<T> T
Calls given function inside opened shark transaction and returns function result.void
Calls given function inside opened shark transaction.static TransactionWrapper
get()
-
Method Details
-
get
- Returns:
- Instance of class
-
doInHibernateTransaction
Calls given function inside opened hibernate transaction. In function we have access to current session passed as function parameter.- Parameters:
runnable
- Function to run
-
doInSneakyHibernateTransaction
Calls given function inside opened hibernate transaction. In function we have access to current session passed as function parameter. Sneaky rethrows any exceptions caught from runnable.- Parameters:
runnable
- Function to run
-
doInHibernateTransaction
Calls given function inside opened hibernate transaction and returns function result. In function we have access to current session passed as function parameter.- Parameters:
callable
-- Returns:
- callable result
-
doInSneakyHibernateTransaction
Calls given function inside opened hibernate transaction and returns function result. In function we have access to current session passed as function parameter. Sneaky rethrows any exceptions caught from callable.- Parameters:
callable
-- Returns:
- callable result
-
doInNewHibernateTransaction
-
doInNewHibernateTransaction
Calls given function inside new hibernate transaction and returns function result.runnable.- Parameters:
callable
-- Returns:
- callable result
-
doInNewHibernateTransaction
public <T> T doInNewHibernateTransaction(TransactionWrapper.HibernateCallable<T> callable, boolean readOnly) Calls given function inside new hibernate transaction and returns function result.runnable.- Parameters:
callable
-- Returns:
- callable result
-
doInSharkTransaction
Calls given function inside opened shark transaction. In function we have access to current session passed as function parameter.- Parameters:
runnable
- Function to run
-
doInSneakySharkTransaction
Calls given function inside opened shark transaction. In function we have access to current session passed as function parameter.- Parameters:
runnable
- Function to run
-
doInSharkTransaction
Calls given function inside opened shark transaction. In function we have access to current session passed as function parameter.- Parameters:
runnable
- Function to runreadOnly
- Read-only transaction
-
doInSharkTransaction
public void doInSharkTransaction(TransactionWrapper.SharkRunnable runnable, int propagationBehaviour) -
doInSharkTransaction
public void doInSharkTransaction(TransactionWrapper.SharkRunnable runnable, int propagationBehaviour, boolean readOnly) -
doInSharkTransaction
Calls given function inside opened shark transaction and returns function result. In function we have access to shark transaction passed as function parameter.- Parameters:
callable
-- Returns:
- callable result
-
doInSneakySharkTransaction
Calls given function inside opened shark transaction and returns function result. In function we have access to shark transaction passed as function parameter.- Parameters:
callable
-- Returns:
- callable result
-
doInSharkTransaction
Calls given function inside opened shark transaction and returns function result. In function we have access to shark transaction passed as function parameter.- Parameters:
callable
-readOnly
-- Returns:
- callable result
-
doInJdbcConnection
-
doInJdbcConnection
-
doInHibernateJdbcConnection
-
doInHibernateJdbcConnection
-