Spring: @Transactional does nothing on a self-invocation

The annotation is applied by a proxy. Calling the method from inside the same bean bypasses the proxy entirely.

Code
@Service
public class OrderService {

    public void placeAll(List<Order> orders) {
        orders.forEach(this::place);   // self-call: NO transaction
    }

    @Transactional
    public void place(Order order) { /* ... */ }
}
Output
place() runs with no transaction when called from placeAll().
Fix: inject the bean into itself, use ObjectProvider, or move place() to another bean.
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11