Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. TransactionStatus status = this.transactionManager.getTransaction(this);
  2.             T result;
  3.             try {
  4.                 result = action.doInTransaction(status);
  5.             }
  6.             catch (RuntimeException ex) {
  7.                 // Transactional code threw application exception -> rollback
  8.                 rollbackOnException(status, ex);
  9.                 throw ex;
  10.             }
  11.             catch (Error err) {
  12.                 // Transactional code threw error -> rollback
  13.                 rollbackOnException(status, err);
  14.                 throw err;
  15.             }
  16.             catch (Exception ex) {
  17.                 // Transactional code threw unexpected exception -> rollback
  18.                 rollbackOnException(status, ex);
  19.                 throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception");
  20.             }
  21.             this.transactionManager.commit(status);
  22.             return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement