Skip to content

Commit f958033

Browse files
committed
2026-02-28-db.md update
1 parent a8ca191 commit f958033

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_posts/db/2026-02-28-db.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ Optional<Inventory> findByProductIdWithPessimisticLock(Long productId);
104104
105105
row별로 버전 컬럼을 사용하여 동시성 문제를 해결합니다.
106106
107-
{% tabs log %}
107+
{% tabs OPTIMISTIC %}
108108
109-
{% tab log 낙관적 락 흐름 %}
109+
{% tab OPTIMISTIC 낙관적 락 흐름 %}
110110
```
111111
🔓 DB 락 없이 조회 → ✏️ @Version으로 체크 → 💥 충돌 시 예외 → 🔄 앱에서 재시도
112112
```
113113
{% endtab %}
114114
115-
{% tab log Entity %}
115+
{% tab OPTIMISTIC Entity %}
116116
```java
117117
public class Inventory {
118118
...
@@ -126,15 +126,15 @@ public class Inventory {
126126
```
127127
{% endtab %}
128128

129-
{% tab log JPA Repository %}
129+
{% tab OPTIMISTIC JPA Repository %}
130130
```java
131131
@Lock(LockModeType.OPTIMISTIC)
132132
@Query("SELECT i FROM Inventory i WHERE i.product.id = :productId")
133133
Optional<Inventory> findByProductIdWithOptimisticLock(Long productId);
134134
```
135135
{% endtab %}
136136

137-
{% tab log Service Code %}
137+
{% tab OPTIMISTIC Service Code %}
138138
```java
139139
public class CreateOrderWithOptimisticLockUseCase {
140140
private final OrderRepository orderRepository;

0 commit comments

Comments
 (0)