@@ -2,6 +2,7 @@ package site.billilge.api.backend.domain.notification.handler
22
33import org.springframework.scheduling.annotation.Async
44import org.springframework.stereotype.Component
5+ import org.springframework.transaction.annotation.Propagation
56import org.springframework.transaction.annotation.Transactional
67import org.springframework.transaction.event.TransactionPhase
78import org.springframework.transaction.event.TransactionalEventListener
@@ -17,7 +18,7 @@ class NotificationEventHandler(
1718 private val memberService : MemberService ,
1819) {
1920 @Async
20- @Transactional
21+ @Transactional(propagation = Propagation . REQUIRES_NEW )
2122 @TransactionalEventListener(phase = TransactionPhase .AFTER_COMMIT )
2223 fun handleRentalApplied (event : RentalAppliedEvent ) {
2324 val member = memberService.findById(event.memberId)
@@ -44,7 +45,7 @@ class NotificationEventHandler(
4445 }
4546
4647 @Async
47- @Transactional
48+ @Transactional(propagation = Propagation . REQUIRES_NEW )
4849 @TransactionalEventListener(phase = TransactionPhase .AFTER_COMMIT )
4950 fun handleRentalCancelled (event : RentalCancelledEvent ) {
5051 val member = memberService.findById(event.memberId)
@@ -57,7 +58,7 @@ class NotificationEventHandler(
5758 }
5859
5960 @Async
60- @Transactional
61+ @Transactional(propagation = Propagation . REQUIRES_NEW )
6162 @TransactionalEventListener(phase = TransactionPhase .AFTER_COMMIT )
6263 fun handleReturnApplied (event : ReturnAppliedEvent ) {
6364 val member = memberService.findById(event.memberId)
@@ -77,7 +78,7 @@ class NotificationEventHandler(
7778 }
7879
7980 @Async
80- @Transactional
81+ @Transactional(propagation = Propagation . REQUIRES_NEW )
8182 @TransactionalEventListener(phase = TransactionPhase .AFTER_COMMIT )
8283 fun handleRentalStatusChanged (event : RentalStatusChangedEvent ) {
8384 val member = memberService.findById(event.memberId)
0 commit comments