Skip to content
Sharp

Spring Core · interview question

How would you explain a common issue when using Spring transactions with self-invocation, and how can you solve it in an interview?

Multiple choiceHardchapter-9-curatedpremiumspring-corepersistence-and-validation
Choose one answer
Answer and explanation

Correct answer

A. Avoid self-invocation by using AOP

Why

Self-invocation bypasses Spring's proxy mechanism, preventing @Transactional from working correctly. Using AOP or restructuring the code to avoid self-calls can solve this problem.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →