码迷,mamicode.com
首页 > 编程语言 > 详细

Java事务的处理

时间:2017-04-11 11:37:16      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:action   work   property   runtime   code   run   span   odi   ext   

@Transactional(propagation = Propagation.REQUIRED,rollbackFor = RuntimeException.class)
基本配置
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"> <property name="transactionManager" ref="transactionManager" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> </beans>

具体查看:http://www.cnblogs.com/younggun/p/3193800.html

Java事务的处理

标签:action   work   property   runtime   code   run   span   odi   ext   

原文地址:http://www.cnblogs.com/victory8023/p/6692441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!