1 Spring中 纯XML 配置事务
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="pooledDataSource"/>
</bean>
<aop:config>
<aop:pointcut expression="execution(* cn.yuanyu.crud.service..*(..))" id="txPoint"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*"/>
<tx:method name="get*" read-only="true"/>
</tx:attributes>
</tx:advice>
2 Spring中 XML+注解 配置事务
一般xml里面配置粗粒度的控制,然后使用注解
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSo