Skip to content
Gradient
  • Home
  • GradientTools
  • Categories
    • Careers & Money
    • Tech & Science
    • History, Culture & Travel
    • Health & Beauty
    • Marketing & Business
    • Life & Learning
    • Engineering
  • Contact Us
  • About US
  • Privacy Policy

Engineering

Real engineering for working Java and Spring Boot developers: hidden bugs that break at scale, proven with tests and fixed with clear trade-offs.

The rollback that never ran: transactional self invocation in Spring Boot

November 10, 2026 by Nabeel Ahmed
Transactional self invocation in a Spring Boot import service: placeAll calls this.placeOne, so the @Transactional annotation on placeOne never starts a transaction

A rejected order leaves its rows behind and a REQUIRES_NEW audit row disappears, because a call through this never reaches Spring’s transactional proxy. A test that records every transaction, and four ways out.

Categories Engineering Tags Databases, Java, Spring Boot

Idempotency key Spring Boot guide: why one retry still charges twice

November 10, 2026 by Nabeel Ahmed
Idempotency key Spring Boot checkout: the service looks the key up, charges the card and saves the order, and only then saves the key, so two overlapping requests both miss the lookup

A checkout that stores every Idempotency-Key still creates two orders when a retry overlaps the first attempt. A test that forces it, why a lock in the JVM only hides it, and three database-backed fixes.

Categories Engineering Tags Databases, Distributed Systems, Java, Spring Boot

Two transfers, two locks: a Java deadlock example that passes code review

October 27, 2026 by Nabeel Ahmed
Java deadlock example: a transfer method locks the source account, checks the balance, then locks the destination; two opposite transfers each hold one lock and wait for the other

A transfer from A to B and one from B to A, at the same moment, can freeze a Java service for good. A test that forces it, how to detect it, and three fixes with their costs.

Categories Engineering Tags Concurrency, Java, Spring Boot

Spring Boot MDC async logs lose the request id, then log the wrong one

October 13, 2026 by Nabeel Ahmed
Spring Boot MDC async bug in our verify run: the request thread logs requestId=req-alice while the @Async thread task-1 logs requestId=null; with a copy-only decorator 100 of 100 retry runs logged the previous request's id; the fixed decorator gave 200 of 200 receipt lines their own requestId

The MDC lives on one thread, and @Async moves your code to another. Why log lines lose the request id or carry a stale one, a test that proves both, and three fixes.

Categories Engineering Tags Concurrency, Java, Spring Boot

Spring Boot cache stampede: 50 requests, 50 identical database queries

October 9, 2026 by Nabeel Ahmed
Spring Boot cache stampede: a @Cacheable price lookup on Caffeine with no lock, so every concurrent miss runs the database query

Every request that misses at the same moment runs the query. Why @Cacheable stampedes on a cold or expired key, a test that proves it, and three fixes compared.

Categories Engineering Tags Concurrency, Java, Performance, Spring Boot

The Spring Boot race condition that sells your last unit twice

October 6, 2026 by Nabeel Ahmed
Spring Boot race condition in a @Transactional checkout method: the stock read, the check and the write-back are highlighted as three separate steps

Two requests read “1 left”, both pass the check, both commit. Why @Transactional does not stop it, a test that proves it every time, and three fixes compared.

Categories Engineering Tags Concurrency, Databases, Java, Spring Boot

Hikari connection is not available? Your REQUIRES_NEW is starving the pool

October 6, 2026 by Nabeel Ahmed
Hikari connection is not available: an audit service marked REQUIRES_NEW, which needs a second pooled connection when a @Transactional checkout calls it

Each checkout holds one pooled connection and waits for a second. Why REQUIRES_NEW starves HikariCP under load, a test that proves it, and three fixes compared.

Categories Engineering Tags Databases, Java, Performance, Spring Boot

RECENT POSTS

  • The rollback that never ran: transactional self invocation in Spring Boot November 10, 2026
  • How to Enable TPM and Secure Boot for Call of Duty and Windows 11 November 10, 2026
  • Idempotency key Spring Boot guide: why one retry still charges twice November 10, 2026
  • Snowfall in Pakistan 2026-27: Where to See Snow and Which Roads Stay Open November 5, 2026
  • 5G in Pakistan: Which Cities Have It, Which Phones Work and What It Costs November 5, 2026

Categories

MUST READ

  • Careers & Money
  • Tech & Science
  • History, Culture & Travel
  • Health & Beauty
  • Marketing & Business
  • Life & Learning

MUST READ

  • Careers & Money
  • Tech & Science
  • History, Culture & Travel
  • Health & Beauty
  • Marketing & Business
  • Life & Learning

IMPORTANT LINKS

  • Home
  • About
  • Team
  • Contact
  • Term and Conditions
  • Disclaimer
  • Privacy Policy
  • Editorial Policy

IMPORTANT LINKS

  • Home
  • About
  • Team
  • Contact
  • Term and Conditions
  • Disclaimer
  • Privacy Policy
  • Editorial Policy
© 2026 Gradient • Built with GeneratePress