Java事务的处理

@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

posted @ 2017-04-11 10:40  Victory-xx  阅读(252)  评论(0编辑  收藏  举报