advancedSpring Internals — Bean Lifecycle & Proxies

Why can @TransactionalEventListener(AFTER_COMMIT) silently stop working in asynchronous event processing?

AFTER_COMMIT relies on the listener running within the SAME thread's transaction synchronization callbacks. If the listener is also marked @Async (running on a different thread) or the publishing transaction never actually commits (e.g., it's read-only or rolled back), the listener may never fire, with no obvious error.

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 response

Next Step

Continue to Why can a poorly written OncePerRequestFilter execute multiple times for a single request?← Back to all Spring Boot & Microservices questions