diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6a18d445 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +demo/** linguist-documentation=false +demo/** linguist-vendored=false \ No newline at end of file diff --git a/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/PessimisticReservationServiceProxy.java b/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/PessimisticReservationServiceProxy.java index 626f6b14..aa80105f 100644 --- a/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/PessimisticReservationServiceProxy.java +++ b/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/PessimisticReservationServiceProxy.java @@ -2,7 +2,7 @@ import jakarta.persistence.LockTimeoutException; -import org.hibernate.PessimisticLockException; +import org.springframework.dao.PessimisticLockingFailureException; import com.thirdparty.ticketing.domain.common.ErrorCode; import com.thirdparty.ticketing.domain.common.TicketingException; @@ -22,7 +22,7 @@ public class PessimisticReservationServiceProxy implements ReservationServicePro public void selectSeat(String memberEmail, SeatSelectionRequest seatSelectionRequest) { try { reservationTransactionService.selectSeat(memberEmail, seatSelectionRequest); - } catch (PessimisticLockException | LockTimeoutException e) { + } catch (PessimisticLockingFailureException | LockTimeoutException e) { log.error(e.getMessage(), e); throw new TicketingException(ErrorCode.NOT_SELECTABLE_SEAT); } @@ -32,7 +32,7 @@ public void selectSeat(String memberEmail, SeatSelectionRequest seatSelectionReq public void reservationTicket(String memberEmail, TicketPaymentRequest ticketPaymentRequest) { try { reservationTransactionService.reservationTicket(memberEmail, ticketPaymentRequest); - } catch (PessimisticLockException | LockTimeoutException e) { + } catch (PessimisticLockingFailureException | LockTimeoutException e) { log.error(e.getMessage(), e); throw new TicketingException(ErrorCode.NOT_SELECTABLE_SEAT); } diff --git a/src/main/java/com/thirdparty/ticketing/global/config/ReservationServiceContainer.java b/src/main/java/com/thirdparty/ticketing/global/config/ReservationServiceContainer.java index f5d7eec6..8c6f974f 100644 --- a/src/main/java/com/thirdparty/ticketing/global/config/ReservationServiceContainer.java +++ b/src/main/java/com/thirdparty/ticketing/global/config/ReservationServiceContainer.java @@ -39,7 +39,6 @@ public ReservationService lettuceReservationServiceProxy( lettuceRepository, cacheReservationTransactionService); } - @Primary @Bean ReservationService optimisticReservationServiceProxy( @Qualifier("persistenceOptimisticReservationService") @@ -47,6 +46,7 @@ ReservationService optimisticReservationServiceProxy( return new OptimisticReservationServiceProxy(persistenceOptimisticReservationService); } + @Primary @Bean ReservationService pessimisticReservationServiceProxy( @Qualifier("persistencePessimisticReservationService")