Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TransactionStatus status = this.transactionManager.getTransaction(this);
- T result;
- try {
- result = action.doInTransaction(status);
- }
- catch (RuntimeException ex) {
- // Transactional code threw application exception -> rollback
- rollbackOnException(status, ex);
- throw ex;
- }
- catch (Error err) {
- // Transactional code threw error -> rollback
- rollbackOnException(status, err);
- throw err;
- }
- catch (Exception ex) {
- // Transactional code threw unexpected exception -> rollback
- rollbackOnException(status, ex);
- throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception");
- }
- this.transactionManager.commit(status);
- return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement