<!--配置声明式事务-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="Datasource" />
</bean>
<!-- 结合aop实现事务的织入-->
<!--<tx:advice>配置事务通知-->
<tx:advice id="txadvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="selectAll" propagation="REQUIRED"/>
<tx:method name="*"></tx:method>
</tx:attributes>
</tx:advice>
<!-- 配置事务切入-->
<aop:config>
<aop:pointcut id="shiwu" expression="execution(* com.itheima.Userserviceimpl.*(..))"/>
<aop:advisor advice-ref="txadvice" pointcut-ref="shiwu"></aop:advisor>
</aop:config>
spring事务管理
最新推荐文章于 2025-12-02 21:20:38 发布
5万+

被折叠的 条评论
为什么被折叠?



