Tagged articles

PessimisticLock

5 articles · Page 1 of 1
Java Tech Workshop
Java Tech Workshop
Apr 19, 2026 · Backend Development

Mastering SpringBoot Concurrency: Pessimistic vs Optimistic Locks Explained

SpringBoot’s @Transactional ensures single‑transaction atomicity, but under high concurrency multiple transactions can still corrupt data; this article dissects why, demonstrates overselling scenarios, and provides detailed implementations of pessimistic (row/table locks) and optimistic (version/timestamp) locking with code, performance tests, and a comprehensive comparison guide.

ConcurrencyMySQLOptimisticLock
0 likes · 24 min read
Mastering SpringBoot Concurrency: Pessimistic vs Optimistic Locks Explained
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 10, 2024 · Backend Development

Why Does Spring Data JPA Insert Duplicate Users? Transaction & Lock Solutions

This article explains why a SpringBoot 3.0.9 application creates duplicate user rows when sending confirmation emails, analyzes the transactional behavior causing the issue, and presents three solutions—including pessimistic locking, narrowing transaction scope, and an event‑driven approach—to ensure data consistency.

EventDrivenPessimisticLockSpringBoot
0 likes · 8 min read
Why Does Spring Data JPA Insert Duplicate Users? Transaction & Lock Solutions
Su San Talks Tech
Su San Talks Tech
Jan 17, 2022 · Backend Development

Understanding Optimistic vs Pessimistic Locks and Advanced Java Lock Types

This article explains the concepts, differences, and appropriate use cases of optimistic and pessimistic locks, exclusive and shared locks, mutex and read‑write locks, fair and unfair locks, reentrant, spin, segment locks, lock upgrades, and lock‑optimization techniques in Java concurrency programming.

LocksOptimisticLockPessimisticLock
0 likes · 13 min read
Understanding Optimistic vs Pessimistic Locks and Advanced Java Lock Types
JavaEdge
JavaEdge
Dec 11, 2021 · Backend Development

Master Java Locks: From Pessimistic to Optimistic and Beyond

This article explains the full spectrum of Java concurrency locks—including pessimistic, optimistic, exclusive, shared, fair, unfair, segment, reentrant, and spin locks—detailing their principles, typical use cases, implementation details, and code examples to help you ace interview questions.

LocksOptimisticLockPessimisticLock
0 likes · 12 min read
Master Java Locks: From Pessimistic to Optimistic and Beyond