Tag

PessimisticLock

0 views collected around this technical thread.

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.

EventDrivenJPAPessimisticLock
0 likes · 8 min read
Why Does Spring Data JPA Insert Duplicate Users? Transaction & Lock Solutions
Xiaokun's Architecture Exploration Notes
Xiaokun's Architecture Exploration Notes
Feb 11, 2020 · Backend Development

Mastering Java Locks: From Optimistic to Fairness and JVM Optimizations

This article provides a comprehensive overview of Java lock mechanisms—including optimistic, pessimistic, reentrant, fair, unfair, read/write, spin, and JVM-level optimizations—illustrated with clear explanations, code snippets, and performance‑tuning tips for high‑concurrency applications.

JVMJavaLocks
0 likes · 15 min read
Mastering Java Locks: From Optimistic to Fairness and JVM Optimizations