Spring: Annotation-driven Transaction Manager

后端 未结 2 1510
陌清茗
陌清茗 2020-12-08 16:51

I\'m setting up a new, JPA+Spring project. What is the difference (for me as a programmer) between:



        
2条回答
  •  醉酒成梦
    2020-12-08 17:45

    The docs say:

    The default mode "proxy" processes annotated beans to be proxied using Spring's AOP framework (following proxy semantics, as discussed above, applying to method calls coming in through the proxy only). The alternative mode "aspectj" instead weaves the affected classes with Spring's AspectJ transaction aspect, modifying the target class byte code to apply to any kind of method call. AspectJ weaving requires spring-aspects.jar in the classpath as well as load-time weaving (or compile-time weaving) enabled. (See Section 7.8.4.5, “Spring configuration” for details on how to set up load-time weaving.)

    It doesn't matter (from a developer's perspective) which mode will be used.

提交回复
热议问题