事务的处理在service层。
<!-- - - - - - - spring Transaction Manager - - - - - - - --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- - - - - - - spring Transaction Attribute - - - - - - - --> <tx:advice id="transactionAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name = "*" isolation = "READ_COMMITTED" propagation = "REQUIRED" rollback-for = "java.lang.Throwable" /> </tx:attributes> </tx:advice> <!--****** weave *********--> <aop:config> <aop:pointcut id="serviceMethod" expression="execution(* com.iss.service.impl.*.*(..))" /> <aop:advisor advice-ref="transactionAdvice" pointcut-ref="serviceMethod" /> </aop:config>