advancedSpring Internals — Bean Lifecycle & Proxies313 of 469
Why can SmartInitializingSingleton trigger expensive database calls before your application is actually ready?
SmartInitializingSingleton.afterSingletonsInstantiated() runs once ALL singleton beans are created, but before the application context is fully refreshed and ApplicationReadyEvent fires — code here that does eager DB warm-up can run before readiness probes or downstream dependencies expect traffic.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a responseNext Step
←PreviousContinue to A @Transactional method calls a REQUIRES_NEW method in the same class. How many transactions run?→
← Back to all Spring Boot & Microservices questions