Skip to main content

The Spring Cache Abstraction: @Cacheable, @CacheEvict, Key Generators and the Self-Invocation Trap

A beginner-first walk through Spring's application-level caching on Spring Boot 4.1.1: what the interceptor actually does, what SimpleKeyGenerator puts in the map, and the four traps that account for most caching bugs — self-invocation, key collisions, eviction timing, and declarations that only fail at the first call. Every figure comes out of a companion project whose 20 tests produce the transcripts. Includes two corrections: @EnableCaching has no exposeProxy attribute, and the documented cache-provider detection order does not match the enum that ships.

Global Exception Handling with ProblemDetail (RFC 9457) in Spring Boot 4

Where a Spring Boot 4 error body actually comes from, what spring.mvc.problemdetails.enabled does and does not cover, and a thirteen-failure matrix under five setups, plus the ways a tidy ProblemDetail setup hides 500s, leaks internals, or changed underneath you in Spring Framework 7.

@Transactional in Spring: Propagation, Isolation, and the Six Ways It Silently Does Nothing

All seven propagation values with runnable proof and transaction-manager logs, the rollback rules, and why catching an inner failure still ends in UnexpectedRollbackException. Plus six ways @Transactional is present, correct, and inert — two of which commit work the code was trying to abandon — and why Propagation.NESTED cannot be used with JpaTransactionManager at all. Spring Boot 4.1.1, JDK 25.

Spring AOP Explained: Pointcuts, Advice Types, and Why Your Aspect Isn’t Firing

An aspect that does not fire produces no error and no log line. A full reference for the ten pointcut designators Spring AOP supports (generated from real matches) and the fourteen it rejects, the difference between JDK and CGLIB proxies measured side by side, and a gallery of six aspects that silently do nothing. Includes two corrections to the reference documentation. Spring Boot 4.1.1, AspectJ 1.9.25.1, JDK 25.

Spring Boot Profiles Done Right: Config Import, Config Trees and Kubernetes ConfigMaps

You set a value in application-prod.yaml, deployed with prod active, and the old value is still in effect. The reason is a single line of the documented precedence list: config data is item 3 and environment variables are item 5. A measured walk through the precedence stack, profile groups and multi-document files, config trees and Kubernetes ConfigMaps, and the spring.config.import ordering that overrides you rather than the other way round.

@ConfigurationProperties vs @Value in Spring Boot 4: Binding, Validation and Relaxed Rules

@Value and @ConfigurationProperties are different mechanisms, not two styles. A measured matrix of which property spellings actually resolve (including the widely repeated claim about @Value and relaxed binding, which is wrong inside Spring Boot), record constructor binding and defaults, validation, and the JDK 23 change that silently stops your IDE metadata being generated. Verified on Spring Boot 4.1.1 and JDK 25.

Why Your Spring Boot App Takes 8 Seconds to Start: A Bean-by-Bean Diagnosis

Spring Boot logs one startup number and hides four phases behind it. This walks through turning on the ApplicationStartup instrumentation that ships switched off, reading the step tree by self time rather than total duration — the mistake that makes people optimise a bean costing 10 ms instead of the one costing 504 — and then puts measured numbers on component scanning (0.11 ms per class inspected, whether or not it is a bean), on the silent truncation a 2048-step buffer performs on your recording, and on the JDK 25 AOT cache, which took 6.93 s to 4.82 s on the companion project without a line of application code changing.