0

I have two entites with JpaRepo Say A and B (I don't have any custom api, I am using spring data rest)

When I do any update to A I use @HandleAfterSave and add an entry to B.

I need to ensure that either both the updates are done or none are done.

example:

If A fails B will obviously fails. But if B fails A should not perform an update ?

What should I do to achieve this ?

Thanks a lot in Advance .

  • Did you check these http://stackoverflow.com/questions/25717127/handle-spring-data-rest-application-events-within-the-transaction/30713264#30713264 http://stackoverflow.com/questions/25717127/handle-spring-data-rest-application-events-within-the-transaction – pvpkiran Apr 04 '17 at 08:14
  • Yes but it does not show what i am trying to do as i am using spring boot data rest ! – harshit jyoti Apr 04 '17 at 12:04

0 Answers0