一、添加cglib.jar
<!-- 事务管理器 --><bean id="txManager"class="org.springframework.orm.hibernate4.HibernateTransactionManager"><!-- <property name="dataSource" ref="myDataSource"></property> --><property name="sessionFactory" ref="sessionFactory" /></bean><aop:config proxy-target-class="true"><aop:pointcut expression="execution(* com.arhat.service.impl.*.*(..))"id="txCut" /><aop:advisor advice-ref="txAdvice" pointcut-ref="txCut" /></aop:config><tx:advice id="txAdvice" transaction-manager="txManager"><!-- 事务的传播属性 --><tx:attributes><tx:method name="*" propagation="SUPPORTS" read-only="true" /><tx:method name="save*" propagation="REQUIRED"></tx:method><tx:method name="update*" propagation="REQUIRED"></tx:method><tx:method name="delete*" propagation="REQUIRED"></tx:method></tx:attributes></tx:advice>
新闻热点
疑难解答