读书人

spring事宜配置实例lt;1gt

发布时间: 2012-10-08 19:54:56 作者: rapoo

spring事务配置实例<1>

<bean id="txManager" ref="dataSource" />
?</bean>
?
?<aop:config proxy-target-/>
??<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionOperation" order="1"/>
?</aop:config>
?
?<tx:advice id="txAdvice" transaction-manager="txManager">
??<tx:attributes>
???<tx:method name="update*" propagation="REQUIRED" rollback-for="Throwable"/>
???<tx:method name="insert*" propagation="REQUIRED" rollback-for="Throwable"/>
???<tx:method name="delete*" propagation="REQUIRED" rollback-for="Throwable"/>
???<tx:method name="save*" propagation="REQUIRED" rollback-for="Throwable"/>
???<!-- other methods use the default transaction settings (see below) -->
???<tx:method name="*" read-only="true" />
??</tx:attributes>
?</tx:advice>
?
?<tx:annotation-driven transaction-manager="txManager" order="0"/>
?<!-- 启用基于@AspectJ切面的驱动器 -->
?<aop:aspectj-autoproxy/>

读书人网 >软件架构设计

热点推荐