Lazy JDBC Connections in Spring Boot 4.1 (Performance Win)
One property change took connection hold time from 2 seconds down to 15 milliseconds. Lazy JDBC connections in Spring Boot 4.1 is a feature you need to know about, and I'll prove the performance difference with real metrics. In this video, we walk through the new spring.datasource.connection-fetch=lazy property in Spring Boot 4.1. We build a complete demo application with Spring Data JDBC, Postgres, Docker Compose, and Spring Boot Actuator to measure the real-world difference between eager and lazy connection fetching. You'll see exactly when this optimization matters and when it won't help. How eager vs lazy JDBC connection fetching works inside @Transactional methods How to enable lazy connections with a single property: spring.datasource.connection-fetch=lazy Building a demo app with Spring Data JDBC, Postgres, Docker Compose, and Actuator metrics Measuring real performance differences using Micrometer metrics via the Actuator endpoint When lazy connections pay off (slow remote calls before writes) and when they don't If you learned something new, smash that thumbs up, subscribe for more Spring Boot 4.1 content, and drop a comment telling me which feature you want me to cover next! 0:00 - The 2 seconds to 15ms result 0:20 - Intro & Spring Boot 4.1 overview 1:15 - Release notes & release highlights page 2:00 - GitHub repo & what we're building 2:50 - Eager vs Lazy connection explained 3:40 - Generating the project on start.spring.io 5:00 - Schema, Customer record & repository setup 6:30 - Building the slow remote client 8:00 - Registration service with @Transactional 9:00 - REST controller endpoint 9:45 - Testing with eager (default) — 2.2 second hold 11:00 - Switching to lazy — 15ms hold time 12:00 - When to use lazy connections (and when not to) 13:00 - Wrap up & what's next 🔗Resources & Links mentioned in this video: GitHub Repository — Lazy JDBC Connections Demo: https://github.com/danvega/jdbc-lazy-... Spring Boot 4.1 Blog Post: https://spring.io/blog/2026/06/10/spr... Spring Boot 4.1 Release Notes: https://github.com/spring-projects/sp... Spring Release Highlights: https://spring.io/projects/release-hi... 👋🏻Connect with me: Website: https://www.danvega.dev Twitter: / therealdanvega Github: https://github.com/danvega LinkedIn: / danvega Newsletter: https://www.danvega.dev/newsletter SUBSCRIBE TO MY CHANNEL: http://bit.ly/2re4GH0 ❤️

Spring Boot 4.1: Block SSRF Attacks with InetAddressFilter

She Asks if I Know Coldplay and This Singer Shocks The Street

Spring Boot Architecture Explained with Diagram (Detailed Explanation)

Getting Started with Spring gRPC in Spring Boot 4.1

Türkei – USA Highlights | Gruppe D, FIFA WM 2026 | sportstudio

Spring Boot + Kafka in Minutes (Your First Message)

Leave Windows 11 Idle for 24 Hours and Watch What Happens

How to Build Your First Spring Boot App (Theory Explained)

How to Externalize Events in Spring Modulith with Kafka

Fake or real? We meet the Omaze winner in her dream home | BUY BETTER SWR

Should You Still Become a Software Engineer in 2026? GitHub VP

Spring Boot Tutorial for Beginners - Crash Course using Spring Boot 3

Introduction to Spring Modulith - Modular Monoliths in Spring Boot

Nothing about the honey badger is normal... and here is why

Why we left Norway 🇳🇴 | An honest recap!!!

Trumps Pool-Fiasko | Peinliche Videos von Politikern zur WM | extra 3 vom 25.06.2026 · Teil 2/2

Scandal in Berlin! Alice Weidel accuses Merz of squandering taxpayer money

Events That Survive Crashes in Spring Modulith

Building AI Agents in Java with Embabel (Getting Started)

