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