Skip to content
Sharp

Spring Core · interview question

What happens if a method in a @Service class invokes another method in the same class that is annotated with @Transactional?

Multiple choiceHardchapter-9-curatedpremiumspring-corecontrollers-services-repositories
Choose one answer
Answer and explanation

Correct answer

A. The transaction is not applied due to self-invocation.

Why

Spring AOP proxies do not intercept self-invoked method calls within the same class, so the @Transactional annotation is ignored in this scenario. To apply transactions, the method should be called from an external class.

Test yourself on Spring Core

A free test with instant, explained results. No account needed.

Start free test
All Spring Core questions →