Spring Configure agent Transaction Management configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.