Skip to content

Commit 71a55eb

Browse files
committed
Fix: 지연로딩 오류로 트랜잭션 리드온리 추가
1 parent 8cda24f commit 71a55eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

back/src/main/java/com/back/domain/mentoring/reservation/service/ReservationService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class ReservationService {
3333
private final ReservationRepository reservationRepository;
3434
private final MentoringStorage mentoringStorage;
3535

36+
@Transactional(readOnly = true)
3637
public Page<ReservationDto> getReservations(Member member, int page, int size) {
3738
Pageable pageable = PageRequest.of(page, size);
3839

@@ -46,6 +47,7 @@ public Page<ReservationDto> getReservations(Member member, int page, int size) {
4647
return reservations.map(ReservationDto::from);
4748
}
4849

50+
@Transactional(readOnly = true)
4951
public ReservationResponse getReservation(Member member, Long reservationId) {
5052
Reservation reservation = reservationRepository.findByIdAndMember(reservationId, member)
5153
.orElseThrow(() -> new ServiceException(ReservationErrorCode.RESERVATION_NOT_ACCESSIBLE));

0 commit comments

Comments
 (0)