Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- spring aop
- multimodule testcontainers
- 형상관리
- springsecurity
- jpa
- 백준
- 알고리즘
- 낙관적 락 재시도
- aop
- kotest testcontainers
- 우아한 테크러닝
- S3
- RefreshToken
- java
- AccessToken
- Spring Cloud Gateway
- ObjectOptimisticLockingFailureException 처리
- 소수찾기 java
- OptimisticLock
- spring DI
- @transactional
- Invalid property 'principal.username' of bean class
- redissonlock aop
- 멀티모듈 테스트컨테이너
- DI
- TestContainers
- netty
- 낙관적 락 롤백
- ObjectOptimisticLockingFailureException
- interface
Archives
- Today
- Total
목록DataIntegrityViolationException not catch (1)
조급하면 모래성이 될뿐
Service에서 DataIntegrityViolationException을 Catch 못함
문제 상황 동시에 같은 좌석이 예약이 되는 경우 적절한 예외를 발생시키고 싶었다. 현재 프로젝트에서 동시에 같은 좌석이 예약되는 경우 DataIntegrityViolationException이 발생한다 id의 조합으로 String타입 id를 생성한다. 따라서 동일한 id조합일 때 insert 할 때 예외가 발생한다. 해당 예외가 발생했을 때 예외 포인트를 정확히 기록하고자 try-catch로 감싸서 IllegalArgumentException을 발생시켰다. 하지만 예외가 잡히지 않았다... 테스트 코드 @Test @DisplayName("예약 실패 - IllegalException") void testReservationIllegalException() { // given User user = saveU..
TroubleShooting/데브코스
2022. 7. 14. 02:40