Skip to content

Commit 527c54b

Browse files
committed
HOTFIX: Transactional 오류 수정
1 parent bec9153 commit 527c54b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/kotlin/site/billilge/api/backend/domain/notification/handler/NotificationEventHandler.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package site.billilge.api.backend.domain.notification.handler
22

33
import org.springframework.scheduling.annotation.Async
44
import org.springframework.stereotype.Component
5+
import org.springframework.transaction.annotation.Propagation
56
import org.springframework.transaction.annotation.Transactional
67
import org.springframework.transaction.event.TransactionPhase
78
import 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

Comments
 (0)