Package org.fcrepo.common.db
Class DbTransactionExecutor
- java.lang.Object
-
- org.fcrepo.common.db.DbTransactionExecutor
-
@Component public class DbTransactionExecutor extends Object
Wrapper around Spring's db transaction management- Author:
- pwinckles
-
-
Constructor Summary
Constructors Constructor Description DbTransactionExecutor()
DbTransactionExecutor(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doInTx(Runnable action)
Executes the runnable within a DB transaction.void
doInTxWithRetry(Runnable action)
Executes the runnable within a DB transaction that will retry entire block on MySQL deadlock exceptions.
-
-
-
Constructor Detail
-
DbTransactionExecutor
public DbTransactionExecutor()
-
DbTransactionExecutor
public DbTransactionExecutor(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
-
Method Detail
-
doInTxWithRetry
public void doInTxWithRetry(Runnable action)
Executes the runnable within a DB transaction that will retry entire block on MySQL deadlock exceptions.- Parameters:
action
- the code to execute
-
-