Mode one <!--using the proxy class to transactionmanager the combined slice transaction management--><tx:advice id= "advice" transaction-manager= " TransactionManager "><tx:attributes><tx:method name=" find* "propagation=" REQUIRED "read-only=" true "/ ><tx:method name= "select*" propagation= "REQUIRED" read-only= "true"/><tx:method name= "load*" propagation = "REQUIRED" read-only= "true"/><tx:method name= "get*" propagation= "REQUIRED"/><tx:method name= "save*" propagation= "REQUIRED"/></tx:attributes></tx:advice><!--define the facets--><AOP:CONFIG><AOP: Pointcut expression= "Execution (*com.yjm.service.*.* (..))" Id= "point"/><aop:advisor advice-ref= "advice" pointcut-ref= "point"/></aop:config>
Mode two <!-- ========================= transaction Management ========================= --><bean id= " Transactioninterceptor "class=" Org.springframework.transaction.interceptor.TransactionInterceptor ">< Property name= "TransactionManager" ><ref bean= "TransactionManager" /></property> <property name= "Transactionattributes" ><props><prop key= "get*" >PROPAGATION_ required</prop><prop key= "find*" >propagation_required,readonly</prop><prop key= "select*" >propagation_required,readonly</prop><prop key= "load*" >PROPAGATION_REQUIRED, readonly</prop><prop key= "save*" >propagation_required</prop><prop key= "add*" >propagation_required</prop><prop key= "insert*" >propagation_required</prop><prop key= "create*" >propagation_required</prop><prop key= "update*" >PROPAGATION_REQUIRED </prop><prop key= "remove*" >propagation_required</prop><prop key= "delete*" >PROPAGATION_REQUIRED</prop><prop key= "exit*" >propagation_required</prop><prop key= "copy*" >PROPAGATION_REQUIRED</prop> <prop key= "move*" >propagation_required</prop><prop key= "synch*" >PROPAGATION_ required</prop><prop key= "clean*" >propagation_required</prop></props></ Property></bean><bean id= "Autoproxy" class= " Org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator "><property name=" Beannames " ><list><value>*service</value></list></property><property name= " Interceptornames "><list><value>transactioninterceptor</value></list></property ></bean>
Spring Proxy Transaction management is the service class that first encapsulates a transaction proxy class and then cuts in to use such rules.
Spring Configure agent Transaction Management configuration