首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

spring 宣言式事务配置文件

2012-09-09 
spring 声明式事务配置文件?xml version1.0 encodingUTF-8?beans xmlnshttp://www.springframe

spring 声明式事务配置文件

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"><!-- 读取 jdbc.properties --><bean id="propertyConfigurer"destroy-method="close"><property name="driverClassName" value="${jdbc.driverClassName}" /><property name="url" value="${jdbc.url}" /><property name="username" value="${jdbc.username}" /><property name="password" value="${jdbc.password}" /><property name="poolPreparedStatements" value="true" /></bean>    <!-- 配置sqlMapClient --><bean id="sqlMapClientLocal" ref="dataSourceLocal"/>  </bean>   <tx:advice id="txAdviceLocal" transaction-manager="transactionManagerLocal"><tx:attributes><tx:method name="save*" propagation="REQUIRED" /><tx:method name="del*" propagation="REQUIRED" rollback-for="Exception"/><tx:method name="insert*" propagation="REQUIRED" rollback-for="Exception" /><tx:method name="add*" propagation="REQUIRED" rollback-for="Exception" /><tx:method name="*" read-only="true" /></tx:attributes></tx:advice><aop:config proxy-target-expression="execution(public * com.service.impl.*.*(..))" /><aop:advisor advice-ref="txAdviceLocal" pointcut-ref="allServiceMethod" /></aop:config></beans>
?

热点排行