<aop:config proxy-target-class=”true”>
<aop:advisor id=”boardTransactionAdvice” advice-ref=”transactionAdvice” pointcut=”execution(* com.test..*Service.*(..))”/>
</aop:config>
이런식으로 AOP를 걸어 진행하게 된다
try {
testDAO.updatePgm(pgm);
} catch (Exception ex) { throw new Exception(ce.exceptionTranslator(ex, “update”)); }
하지만 Service 단에서 위와 같이 Exception 처리를 하게되면 Rollback이 되지않는다
해결책은!
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
위의 구문으로 강제롤백을 시켜주면 된다
0개의 댓글