0

I have a method which invokes a DAO call something like this

@Overide
public List methodGetList (Parameter) {
 List myList = listDao.getList()
}

I want to retry if the dao layer throws SQL Exception. Where should the @Retryable annotation should be used, on the method in the interface, or on the class giving the implementation or on the getList() method in the DAO.

And I am using following XML configuration to enable retry in the application


 <context:annotation-config />
    <aop:aspectj-autoproxy />

    <bean class="org.springframework.retry.annotation.RetryConfiguration" />

Any help ?

1 Answers1

0

If you are using 1.2 or later (current is 1.2.4), it can go on either the interface or the implementation thanks to this fix.

@Recover currently only works on the interface PR here.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179