Transactional tx = method.getAnnotation(Transactional.class);
if (tx == null) {
tx = method.getDeclaringClass().getAnnotation(Transactional.class);
}
if (tx != null) { // TODO: find Bean instead of reflection
if (new ExceptionPriotiryRules(tx.rollbackOn(), tx.dontRollbackOn()).accept(error)) {
policy.setRollbackOnly();
}
}
}
policy.commit();