Skip to content
Tagged articles

database locking

10 articles · Page 1 of 1
liandk
liandk
Oct 12, 2026 · Backend Development

AI-Generated SQL Locks Database, Exhausts Tomcat Connection Pool: Production Post-Mortem

A production post-mortem reveals how AI-generated SQL caused long-running queries that locked SQL Server, exhausted Tomcat's 300-connection pool, and repeatedly hung the service until restart; the article details root-cause analysis, missing SQL execution timeout, and fixes including connection pool abandonment recovery, query optimization, and monitoring alerts.

AI-generated SQLConnection LeakSQL Server
0 likes · 8 min read
AI-Generated SQL Locks Database, Exhausts Tomcat Connection Pool: Production Post-Mortem
Architecture & Thinking
Architecture & Thinking
Aug 10, 2026 · Backend Development

From a Config Update API to Locking Strategies: Optimistic vs Pessimistic Locks Explained

After encountering potential data overwrite when updating configuration via an API, the author implements an optimistic lock using version numbers and revisits the fundamentals, comparing pessimistic and optimistic locking mechanisms, their implementations in SQL and Java, performance traits, pitfalls, and guidelines for choosing the appropriate strategy.

JavaOptimistic Lockconcurrency control
0 likes · 8 min read
From a Config Update API to Locking Strategies: Optimistic vs Pessimistic Locks Explained
Linyb Geek Road
Linyb Geek Road
May 15, 2026 · Backend Development

Idempotency in Practice: Handling the Same Key with Different Parameters

The article explains why simple key‑based idempotency fails when a second request carries different parameters, and demonstrates how to use database row locks, request fingerprinting, state machines, and explicit error handling to guarantee safe, non‑duplicate execution in payment‑critical APIs.

API DesignIdempotencyMessage Queue
0 likes · 13 min read
Idempotency in Practice: Handling the Same Key with Different Parameters
Architecture Digest
Architecture Digest
Sep 19, 2025 · Backend Development

Mastering Message Idempotency: From Simple Checks to State‑Machine Solutions

This article explores the challenges of duplicate message consumption in distributed systems, explains why naive de‑duplication fails under high concurrency, and presents four progressively robust idempotency strategies—from database pessimistic locks and local message tables to a state‑machine approach with Redis or MySQL, highlighting their trade‑offs.

IdempotencyMessage Queuebackend development
0 likes · 11 min read
Mastering Message Idempotency: From Simple Checks to State‑Machine Solutions
Lobster Programming
Lobster Programming
Aug 2, 2024 · Backend Development

Ensuring Idempotent Consumption in MQ: Strategies and Code Examples

To prevent duplicate processing when integrating message queues for rate limiting and decoupling, this article explains idempotency concepts, common pitfalls, and five practical solutions—including query checks, pessimistic and optimistic locking, deduplication tables, and non‑transactional approaches—complete with code snippets and diagrams.

IdempotencyMessage Queuedatabase locking
0 likes · 11 min read
Ensuring Idempotent Consumption in MQ: Strategies and Code Examples
MaGe Linux Operations
MaGe Linux Operations
Apr 9, 2024 · Databases

How to Simulate and Prevent SQL Server Deadlocks: A Step-by-Step Guide

This article explains what SQL Server deadlocks are, why they occur, demonstrates a reproducible deadlock scenario with T‑SQL code, and provides practical strategies such as proper schema design, indexing, query optimization, shorter transactions, appropriate isolation levels, and monitoring to minimize deadlock occurrences.

SQL Serverdatabase lockingdeadlock
0 likes · 9 min read
How to Simulate and Prevent SQL Server Deadlocks: A Step-by-Step Guide
Selected Java Interview Questions
Selected Java Interview Questions
Oct 30, 2023 · Databases

Understanding SELECT ... FOR UPDATE Locks in MySQL

This article explains how MySQL's SELECT ... FOR UPDATE statement applies different lock types—row, table, or none—depending on whether the WHERE clause uses primary keys, unique indexes, regular indexes, range queries, non‑indexed fields, or returns no rows, illustrated with practical transaction examples.

Row LockSELECT FOR UPDATESQL
0 likes · 9 min read
Understanding SELECT ... FOR UPDATE Locks in MySQL
Architect
Architect
Feb 24, 2022 · Backend Development

Design and Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Technical Characteristics, Request Chain, and Lock Strategies

This article examines flash‑sale systems by outlining typical business scenarios, analyzing read‑heavy and high‑concurrency technical traits, detailing the end‑to‑end request flow, and comparing optimistic, retry‑optimistic, and pessimistic locking mechanisms with practical SQL examples and performance tables.

Optimistic Lockbackend architecturedatabase locking
0 likes · 9 min read
Design and Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Technical Characteristics, Request Chain, and Lock Strategies