How to handle internal calls on Spring/EJB/Mockito… proxies?
问题 As you many know when you proxy an object, like when you create a bean with transactional attributes for Spring/EJB or even when you create a partial mock with some frameworks, the proxies object doesn't know that, and internal calls are not redirected, and then not intercepted either... That's why if you do something like that in Spring: @Transactionnal public void doSomething() { doSomethingInNewTransaction(); doSomethingInNewTransaction(); doSomethingInNewTransaction(); } @Transactional