spring事务配置实例<1>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<aop:config proxy-target-class="true">
<aop:pointcut id="transactionOperation"
expression="execution(* com.oa..*Facade.*(..))" />
<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/>