@Transactional (propagation = Propagation.required,rollbackfor = RuntimeException. Class)
Basic Configuration
<?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/txhttp://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>
Specific view: http://www.cnblogs.com/younggun/p/3193800.html
Processing of Java Transactions