← Quiz: Spring AOP and Proxies: all 10 questions
Quiz: Spring AOP and Proxies · Question 9 of 10
What is the cleanest fix for the self-invocation problem?
What is the cleanest fix for the self-invocation problem?
- A.Make the inner method static
- B.Move the inner method into a separate bean and inject that bean
- C.Make the inner method private
- D.Add @Transactional to the controller
Answer & explanation
Correct answer: Move the inner method into a separate bean and inject that bean
A call to another bean goes through that bean's proxy, so its advice runs.
Can you get the rest right without peeking?
Take the timed Quiz: Spring AOP and Proxies quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →