Skip to content

Commit 4d67127

Browse files
committed
docs: 동시성 이슈 관련 로직 추가
1 parent 8e14eed commit 4d67127

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/week2/02-sequence-diagrams.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ sequenceDiagram
284284
285285
OrderFacade ->> OrderService: createOrder(userId, items)
286286
OrderService -->> OrderFacade: OrderEntity
287-
288-
OrderFacade ->> ProductService: decreaseStock(productId, quantity)
287+
288+
%% Atomic Update 실행UPDATE product SET stock = stock - ? WHERE id = ? AND stock >= ?
289+
OrderFacade ->> ProductService: decreaseStock(productId, quantity) (Execute Atomic Updates)
289290
ProductService -->> OrderFacade: success
290291
291292
OrderFacade ->> PointService: deductPoints(userId, totalPrice)

0 commit comments

Comments
 (0)