Conference India 2026 โ€ข Nov 26, 2026 โ€ข Session details

When Caches Lie: Solving Transactional Integrity and Distributed Race Conditions in Spring Boot

Shuchita Prasad

Are your Spring Boot caches lying to you after a transaction rollback? Prevent ghost writes and distributed race conditions using transaction hooks and atomic Lua scripts.

Pause
Mute Enter Fullscreen
#1 about 6 min

Demonstrating ghost writes in Spring Boot cache and database

Combining @Transactional and @CachePut naively causes ghost writes where the cache updates even after the database transaction rolls back due to a constraint violation.

#2 about 5 min

Spring AOP proxy ordering and transaction synchronization hooks

Because CGLIB proxies execute the cache interceptor inside the transaction interceptor, developers must use TransactionSynchronizationManager afterCommit hooks to prevent premature cache updates.

#3 about 4 min

Configuring transaction-aware cache managers in Spring Boot

Reordering AOP annotations fails during nested transactional method calls, making transaction-aware cache manager configuration the reliable solution for synchronizing commits.

#4 about 3 min

Reproducing stale read race conditions across distributed nodes

In distributed systems sharing a common cache, a slow reader thread can overwrite newer cached data from a concurrent write transaction with stale database values.

#5 about 4 min

Preventing stale reads with atomic Lua compare-and-swap scripts

Executing version-guarded compare-and-swap Lua scripts directly on the cache server ensures older database read versions cannot overwrite newer cached entries.

#6 about 3 min

Architectural takeaways for cache and database transaction harmony

Maintaining cache-database consistency requires enforcing Lua cache managers at the framework level, tracking versions independently of eviction, and relying on post-commit hooks.

#7 about 3 min

Clarifying compare-and-swap mechanics during slow read threads

When a paused thread resumes after garbage collection, version comparison drops its stale cache write attempt without requiring an extra database query.

Matching moments

5:48 min

Balancing delivery latency with stream reliability and scale

Phil Cluff ยท LIVE

1:17 min

Demonstrating the Spring Petclinic AOT cache generation

Ana Maria Mihalceanu Ana Maria Mihalceanu ยท World Congress 2026 Europe

1:35 min

Optimizing Spring Boot applications with AOT caching

Ana Maria Mihalceanu Ana Maria Mihalceanu ยท World Congress 2026 Europe

3:16 min

Q&A on database vendor lock-in and alternative architectural choices

George Asafev ยท World Congress 2023

1:13 min

Audience questions on cache sharing and pipelines

Thijs Feryn Thijs Feryn ยท World Congress 2026 Europe

1:58 min

Trade-offs between storage and network resources in caching architectures

Pierre-Luc Noel +1 ยท World Congress 2023