# locking

Locking is a computing technique for synchronizing access to shared resources through mutual exclusion, ensuring that at most one thread executes a protected section at a time.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Decoding isolation levels: I built a toy DB to force dirty reads and phantom reads

DevFeed: [Decoding isolation levels: I built a toy DB to force dirty reads and phantom reads](<https://devfeed.tech/articles/decoding-isolation-levels-i-built-a-toy-db-to-force-dirty-reads-and-phantom-reads-39587.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/35-isolation-levels-toy-db-dirty-phantom-reads/>)

Author: hello@ankit-rana.com

Published: 2026-08-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Python](<https://devfeed.tech/topics/python.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [locking](<https://devfeed.tech/topics/locking.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [databases](<https://devfeed.tech/tags/databases.md>), [isolation-levels](<https://devfeed.tech/tags/isolation-levels.md>), [locking](<https://devfeed.tech/tags/locking.md>), [mvcc](<https://devfeed.tech/tags/mvcc.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [python](<https://devfeed.tech/tags/python.md>), [sql](<https://devfeed.tech/tags/sql.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

A hands-on tutorial uses a roughly 200-line Python toy database to reproduce transaction anomalies and explain why isolation levels behave differently across PostgreSQL and MySQL InnoDB. It shows that the ANSI SQL isolation table does not fully describe engine behavior, including PostgreSQL's handling of READ UNCOMMITTED and REPEATABLE READ, and MySQL InnoDB's snapshot and next-key locking behavior.

### Source excerpt

The ANSI isolation table lists which anomalies each level permits, but it does not describe what your engine actually does: Postgres silently upgrades READ UNCOMMITTED to READ COMMITTED, and its REPEATABLE READ prevents phantoms that the standard allows. Phantom reads are a locking problem rather than a row problem, because you cannot lock a row that does not exist yet. Snapshot isolation stops every anomaly the table names and still permits write skew, which the table never mentions.

## Coordinate access to shared resources with a distributed lock built on Temporal Workflows

DevFeed: [Coordinate access to shared resources with a distributed lock built on Temporal Workflows](<https://devfeed.tech/articles/coordinate-access-to-shared-resources-with-a-distributed-lock-built-on-temporal-workflows-35762.md>)

Original publisher: [Read original article](<https://temporal.io/blog/coordinate-access-to-shared-resources-with-a-distributed-lock-built-on-temporal-workflows>)

Author: Keith Tenzer

Published: 2026-06-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [locking](<https://devfeed.tech/topics/locking.md>)

Tags: [distributed](<https://devfeed.tech/tags/distributed.md>), [lease](<https://devfeed.tech/tags/lease.md>), [locking](<https://devfeed.tech/tags/locking.md>), [locks](<https://devfeed.tech/tags/locks.md>), [recovery](<https://devfeed.tech/tags/recovery.md>), [resource](<https://devfeed.tech/tags/resource.md>), [temporal-concepts](<https://devfeed.tech/tags/temporal-concepts.md>), [workflows](<https://devfeed.tech/tags/workflows.md>)

### AI overview

This guide describes a reusable, durable distributed lock for Temporal Workflows. It models each permit as a short-lived child Workflow, uses Workflow IDs for atomic acquisition, and uses Signals and lease timeouts to release locks and recover orphaned permits.

### Source excerpt

This guide details a reusable, durable distributed lock for Temporal Workflows that doesn't rely on an external database, central limiter, or any shared state.

## Track customer loyalty points with durable workflows

DevFeed: [Track customer loyalty points with durable workflows](<https://devfeed.tech/articles/track-customer-loyalty-points-with-durable-workflows-35824.md>)

Original publisher: [Read original article](<https://temporal.io/blog/entity-workflow-loyalty-points>)

Author: Cecil Phillip

Published: 2026-06-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [account](<https://devfeed.tech/topics/account.md>), [business logic](<https://devfeed.tech/topics/business-logic.md>), [Database](<https://devfeed.tech/topics/database.md>), [real-time](<https://devfeed.tech/topics/real-time.md>), [locking](<https://devfeed.tech/topics/locking.md>), [retry](<https://devfeed.tech/topics/retry.md>), [service](<https://devfeed.tech/topics/service.md>), [upgrade](<https://devfeed.tech/topics/upgrade.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>)

Tags: [account](<https://devfeed.tech/tags/account.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [customer](<https://devfeed.tech/tags/customer.md>), [database](<https://devfeed.tech/tags/database.md>), [locking](<https://devfeed.tech/tags/locking.md>), [loyalty](<https://devfeed.tech/tags/loyalty.md>), [loyalty-points](<https://devfeed.tech/tags/loyalty-points.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [process](<https://devfeed.tech/tags/process.md>), [query](<https://devfeed.tech/tags/query.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [retry](<https://devfeed.tech/tags/retry.md>), [service](<https://devfeed.tech/tags/service.md>), [temporal](<https://devfeed.tech/tags/temporal.md>), [temporal-concepts](<https://devfeed.tech/tags/temporal-concepts.md>), [upgrades](<https://devfeed.tech/tags/upgrades.md>), [workflows](<https://devfeed.tech/tags/workflows.md>)

### AI overview

This article explains how to track customer loyalty points with durable Entity Workflows in Temporal. Each customer has a persistent workflow that maintains points, tier status, and activity history, while Signals handle accruals, Updates validate redemptions, and Queries read current balances.

### Source excerpt

Track loyalty points with durable Entity Workflows in Temporal. See how to handle accruals, tier upgrades, and redemptions for each customer.

## Fixing SQLite Database Locks in Spring Boot with Connection and Transaction Configuration

DevFeed: [Fixing SQLite Database Locks in Spring Boot with Connection and Transaction Configuration](<https://devfeed.tech/articles/how-we-fixed-sqlite-database-locks-in-spring-boot-and-got-a-5x-performance-boost-38750.md>)

Original publisher: [Read original article](<https://www.paleblueapps.com/rockandnull/spring-boot-sqlite-locking-fix/>)

Author: Anil Kumar Beesetti

Published: 2026-01-30T10:36:55Z

Content type: tutorial

Language: en

Sources: [Rock and Null](<https://devfeed.tech/sources/rock-and-null.md>)

Topics: [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [locking](<https://devfeed.tech/topics/locking.md>), [jpa](<https://devfeed.tech/topics/jpa.md>), [optimize](<https://devfeed.tech/topics/optimize.md>)

Tags: [hikaricp](<https://devfeed.tech/tags/hikaricp.md>), [jpa](<https://devfeed.tech/tags/jpa.md>), [locking](<https://devfeed.tech/tags/locking.md>), [locks](<https://devfeed.tech/tags/locks.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [performance](<https://devfeed.tech/tags/performance.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

This tutorial explains how a Spring Boot application using SQLite experienced intermittent database locks and request failures. It attributes the issue to connection pooling and lifecycle settings, then describes configuring HikariCP for a single connection, tightening connection management, enabling leak detection, disabling Open-in-View, and controlling transactions manually. In the reported k6 load test, throughput increased from 1,736 to 11,381 requests in five minutes, success rate rose from 76% to 99%, and failed requests fell from 411 to 1.

### Source excerpt

Struggling with intermittent database locks in your Spring Boot and SQLite setup? Learn the specific HikariCP and JPA configurations we used to eliminate production hangs and increase throughput by 6.5x.

## MVCC and serializability in HyPer

DevFeed: [MVCC and serializability in HyPer](<https://devfeed.tech/articles/mvcc-and-serializability-in-hyper-39630.md>)

Original publisher: [Read original article](<https://www.gauravsarma.com/posts/2024-11-06_MVCC-and-serializability-in-HyPer-564430884c9a>)

Published: 2024-11-06T00:00:00Z

Content type: article

Language: en

Sources: [Gaurav Sarma's Blog](<https://devfeed.tech/sources/gaurav-sarma-s-blog.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [locking](<https://devfeed.tech/topics/locking.md>), [Deadlock](<https://devfeed.tech/topics/deadlock.md>), [processing](<https://devfeed.tech/topics/processing.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrency-control](<https://devfeed.tech/tags/concurrency-control.md>), [database](<https://devfeed.tech/tags/database.md>), [deadlock](<https://devfeed.tech/tags/deadlock.md>), [locking](<https://devfeed.tech/tags/locking.md>), [mvcc](<https://devfeed.tech/tags/mvcc.md>), [processing](<https://devfeed.tech/tags/processing.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

This article explains Multi-Version Concurrency Control (MVCC), contrasts it with Two-Phase Locking, and introduces MVCC patterns and techniques used in HyPer. It discusses locking phases, deadlocks, cascading rollbacks, and concurrency limitations.

### Source excerpt

. [MVCC and Serializability in HyPer](mvcc-and-serializability-in-hyper-cover...

## Distributed Locking with Redis

DevFeed: [Distributed Locking with Redis](<https://devfeed.tech/articles/distributed-locking-with-redis-37697.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/distributed-locks-redis/>)

Author: Carlos Alexandro Becker

Published: 2017-03-04T00:00:00Z

Content type: article

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [locking](<https://devfeed.tech/topics/locking.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>), [Java](<https://devfeed.tech/topics/java.md>), [Server](<https://devfeed.tech/topics/server.md>), [Database](<https://devfeed.tech/topics/database.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [java](<https://devfeed.tech/tags/java.md>), [locking](<https://devfeed.tech/tags/locking.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [redis](<https://devfeed.tech/tags/redis.md>), [security](<https://devfeed.tech/tags/security.md>), [server](<https://devfeed.tech/tags/server.md>)

### AI overview

This article describes ContaAzul's distributed locking mechanism for scheduled tasks running across multiple servers. It explains the earlier Hazelcast-based design and the operational issues that motivated re-implementation, while the title identifies Redis as the article's locking technology.

### Source excerpt

At ContaAzul, we have several old pieces of code that are still running in production. We are committed to gradually re-implement them in better ways.

## PostgreSQL 9.4 - What I was hoping for

DevFeed: [PostgreSQL 9.4 - What I was hoping for](<https://devfeed.tech/articles/postgresql-9-4-what-i-was-hoping-for-41162.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2014/02/25/PostgreSQL-9.4-What-I-Wanted/>)

Author: Map

Published: 2014-02-25T20:55:56Z

Content type: opinion

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [locking](<https://devfeed.tech/topics/locking.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [json](<https://devfeed.tech/tags/json.md>), [locking](<https://devfeed.tech/tags/locking.md>), [make](<https://devfeed.tech/tags/make.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

### AI overview

An opinion article reviews PostgreSQL 9.4 features the author hoped would be included, focusing on upsert, improved JSON support, and easier extension packaging. It says upsert remained unresolved because of syntax, locking, and concurrency concerns, while proposed JSON and hstore improvements were still at risk.

### Source excerpt

Theres no doubt that the 9.4 release of PostgreSQL will have some great improvements. However, for all of the improvements it delivering it had the promise of being perhaps the most impactful release of Postgres yet. Several of the features that would have given it my stamp of best release in at least 5 years are now already not making it and a few others are still on the border. Here's a look at few of the things that were hoped for and not to be at least until another 18 months. Upsert Upsert, merge, whatever you want to call it, this is been a sore hole for sometime now. Essentially this is insert based on this ID or if that key already exists update other values. This was something being worked on pretty early on in this release, and throughout the process continuing to make progress. Yet as progress was made so were exteneded discussions about syntax, approach, etc. In the end two differing views on how it should be implemented have the patch still sitting there with other thoughts on an implementation but not code ready to commit. At the same time I'll acknowledge upsert as a hard problem to address. The locking and concurrency issues are non-trivial, but regardless of those having this in there mostly kills the final argument for anyone to chose MySQL. Better JSON JSON is Postgres is super flexible, powerful, and generally slow. Postgres does validation and some parsing of JSON, but without something like PLV8, or functional indexes you may not get great performance. This is because under the covers the JSON is represented as text and as a result many of the more powerful indexes that could lend benefit, such as GIN or GIST, simply don't apply here. As a related effort to this hstore, the key/value store, is working on being updated. This new support will add types and nesting making it much more usable overall. However the syntax and matching of how JSON functions isn't guranteed to be part of it. The proposal and actually work is still there and not rejecte

## Single SQLite connection - Kevin Galligan

DevFeed: [Single SQLite connection - Kevin Galligan](<https://devfeed.tech/articles/single-sqlite-connection-kevin-galligan-38049.md>)

Original publisher: [Read original article](<https://touchlab.co/2011-10-single-sqlite-connection>)

Published: 2011-10-15T04:00:00Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Android](<https://devfeed.tech/topics/android.md>), [locking](<https://devfeed.tech/topics/locking.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [databases](<https://devfeed.tech/tags/databases.md>), [locking](<https://devfeed.tech/tags/locking.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>)

### AI overview

The article recommends using one statically held SQLiteOpenHelper instance in an Android app, initialized lazily with synchronization, instead of opening multiple SQLite connections. It argues that the connection can remain open for the app's lifetime and that the reported close exception occurs when another connection is opened while one already holds a file lock.

### Source excerpt

If you look back at my earlier post, android sqlite locking, I demonstrated that more than one sqlite connection was really bad. Bad-bad. OK, so now what? How do you keep one connection and manage it? Back when I worked on some earlier versions of ORMLite, I coded this big, complex framework that would do reference counting, and close the connection when nobody had a reference to it, and that worked pretty good. The downside?

## Android Sqlite Locking - Kevin Galligan

DevFeed: [Android Sqlite Locking - Kevin Galligan](<https://devfeed.tech/articles/android-sqlite-locking-kevin-galligan-38042.md>)

Original publisher: [Read original article](<https://touchlab.co/2011-01-android-sqlite-locking>)

Published: 2011-01-25T05:00:00Z

Content type: article

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [locking](<https://devfeed.tech/topics/locking.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Database](<https://devfeed.tech/topics/database.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [database](<https://devfeed.tech/tags/database.md>), [locking](<https://devfeed.tech/tags/locking.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>)

### AI overview

This article examines SQLite database locking on Android, focusing on SQLiteOpenHelper instances, multiple connections, and concurrent access. It explains that SQLite serializes writes through file-level locking, while simultaneous writes from distinct connections can fail without waiting and may only produce a LogCat message if the wrong SQLiteDatabase method is used.

### Source excerpt

Recently I've been doing quite a bit of work with the Android Sqlite database. Mostly with the android piece of ormlite. The Android examples cover some basic Sqlite usage, but they really don't go into depth with regards to proper usage patters, and more importantly, improper usage patters. Most examples and documentation is slated towards using very basic database queries, and beyond that, creating a ContentProvider.