@Transactional(rollbackFor=BusinessException.class)
public int insertTest(Map<String, Object> commandMap) throws BusinessException {
int cnt1;
int cnt2;
try {
cnt1 = sampleDao.insertTest1(commandMap);
cnt2 = sampleDao.insertTest2(commandMap);
} catch (Exception e) {
throw new BusinessException(".........");
}
return 0;
}
public int insertTest(Map<String, Object> commandMap) throws BusinessException {
int cnt1;
int cnt2;
try {
cnt1 = sampleDao.insertTest1(commandMap);
cnt2 = sampleDao.insertTest2(commandMap);
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new BusinessException(".........");
}
return 0;
}
참조
'프로그래밍 > Java' 카테고리의 다른 글
Java 필터 개념 정리 (0) | 2021.03.03 |
---|---|
쿼리 결과 xml, xls 파일로 특정경로 업로드하기 (0) | 2020.09.15 |
프리징 현상 해결방법 (0) | 2019.12.18 |
JDK, JRE, JVM 은 무엇인가 (0) | 2019.09.28 |
생성자 (0) | 2019.09.22 |
댓글