LuTiao Programming
Aug 26, 2026 · Backend Development
Why a 5 ms SQL Query Holds a DB Connection for 500 ms – The Hidden Transaction Issue
The article explains how a fast SQL statement can occupy a database connection for hundreds of milliseconds because Spring’s @Transactional starts the transaction and acquires the connection long before the first JDBC statement, and shows how the new Spring Boot 4.1 `connection‑fetch: lazy` setting postpones the acquisition to solve the problem.
Connection PoolHikariCPLazyConnectionDataSourceProxy
0 likes · 12 min read
