Below is my requirement
begin trans
insertData();
updateData();
end trans
Also lets say insertDta method throws some error then I need to retry 5 times .Same with updateData().I should not retry both the methods at the same time i.e if i retry m2() 5 times them m1() should not be retried. Is below the correct way to do it? I call m3() from another class . My concern is that interceptors are added in correct and deterministic order.
@Repository
DaoA
{
void insertData();
}
@Repository
DaoB
{
void updateData();
}
Below is my Service class .
@Service
ServiceA
{
@Retryable( maxAttempts = 5)
public void m1 ()
{
daoA.insertData();
}
@Retryable( maxAttempts = 5)
public void m2 ()
{
daoB.updateData();
}
@Transactional
public void m3 ()
{
m1();
m2();
}