Spring adds service to transaction management, settings in the Applicationcontext.xml file

Source: Internet
Author: User

The settings in the Applicationcontext.xml file are:

1<beans>2<bean id= "Sessionfactory"class= "Org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" >3<property name= "DataSource" ref= "DataSource"/>4<!--annotations are too many classes, can be configured using Packagestoscan, directly scan the package--5<property name= "Packagestoscan" >6<list>7<value>com.lcsoft.mobile.bean</value>8</list>9</property>Ten          One<property name= "Hibernateproperties" > A<props> -<prop key= "Hibernate.dialect" >${hibernate.dialect}</prop> -<prop key= "Hibernate.show_sql" >${hibernate.showsql}</prop> the</props> -</property> -</bean> -      +<!--define the transaction manager (declarative transactions)-- -<bean id= "TransactionManager" +         class= "Org.springframework.orm.hibernate3.HibernateTransactionManager" > A<property name= "Sessionfactory" ref= "Sessionfactory"/> at</bean> -<tx:advice id= "Txadvice" transaction-manager= "TransactionManager" > -<tx:attributes> -<tx:method name= "*" propagation= "REQUIRED"/> -</tx:attributes> -</tx:advice> in      -<aop:config> to<aop:pointcut id= "Interceptorpointcuts" +expression= "Execution (* com.mysoft.mobile.*.* (..))"/> -<aop:advisor advice-ref= "Txadvice" thepointcut-ref= "Interceptorpointcuts"/> *</aop:config> $     Panax Notoginseng<bean id= "Sysuserservice" -         class= "Org.springframework.transaction.interceptor.TransactionProxyFactoryBean" the         Abstract= "true" > +<property name= "TransactionManager" ref= "TransactionManager"/> A<property name= "Transactionattributes" > the<props> +<prop key= "push*" > -propagation_supports,readonly,-dataaccessexception,-baseexception $</prop> $</props> -</property> -</bean> the</beans>

Spring adds service to transaction management, settings in the Applicationcontext.xml file

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.