fix: SessionPersistenceService 트랜잭션 내 엔티티 재조회 및 중복 실행 방지#71
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the session persistence logic to use session IDs instead of entity objects and introduces state validation checks before updating session statuses. A review comment suggests improving the validation in saveCompletedSession by ensuring the session is in the IN_PROGRESS state before proceeding, rather than only checking if it is already COMPLETED. This change would ensure consistency with the failure handling logic and prevent invalid state transitions from a FAILED status.
| if (session.getStatus() == SessionStatus.COMPLETED) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
saveCompletedSession 메서드에서 세션 상태가 COMPLETED인 경우만 체크하고 있습니다. 이미 실패(FAILED)한 세션이 완료 처리되는 것을 방지하고, saveFailedSession 메서드(35라인)의 검증 로직과 일관성을 유지하기 위해 IN_PROGRESS 상태가 아닌 경우 처리를 중단하도록 조건을 변경하는 것이 상태 관리 측면에서 더 안전합니다.
| if (session.getStatus() == SessionStatus.COMPLETED) { | |
| return; | |
| } | |
| if (session.getStatus() != SessionStatus.IN_PROGRESS) { | |
| return; | |
| } |
📝 작업 내용 (Description)
SessionPersistenceService 트랜잭션 내 엔티티 재조회 및 중복 실행 방지
🔄 변경 유형 (Type of Change)
✅ 체크리스트 (Checklist)