beginnerWhy Local Transactions Fail
Why can't @Transactional protect a call to a different microservice's REST API?
@Transactional only controls the local database connection/transaction it's bound to — a network call to another service is entirely outside that scope and cannot be rolled back by it.
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