🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Make the inner method static
  2. B.Move the inner method into a separate bean and inject that bean
  3. C.Make the inner method private
  4. 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 →