The reason aop declarative transaction does not work

Because the business layer called try {} catch () {} and the exception is not thrown in the catch, the transaction does not work so the spring aop

Spring AOP exception trap principle:
        the method being intercepted, must explicitly throw an exception and does not do any treatment, so AOP to Exception caught in method, and then roll back.
        In other words, in the method Service layer need not be used try ... catch
  or the last of the catch plus throw new RuntimeException ();

Such a program will be captured AOP, and then roll back.

Guess you like

Origin www.cnblogs.com/west-iversion/p/12173662.html