Spring事务操作——声明式事务管理(注解)

第一步、配置事务管理器(xml文件)


第二步、配置事务注解

<!-- 事务管理交由Spring管理 -->
	<tx:annotation-driven transaction-manager="transactionManager" />

第三步、在要使用事务的方法所在类的上面添加注解

@Transactional

猜你喜欢

转载自blog.csdn.net/iilegend/article/details/80978225