spring ibatis 声明式事务 配置
来源:互联网 发布:算法工程师需要哪些知识 编辑:程序博客网 时间:2024/05/17 08:53
<?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/lang
http://www.springframework.org/schema/lang/spring-lang-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url"
value="jdbc:oracle:thin:@10.22.254.83:1521:JDEDM01">
</property>
<property name="username" value="edmadmin"></property>
<property name="password" value="edm_landmark"></property>
</bean>
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>/ibatis/SqlMapConfig.xml</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource"/>
</property>
</bean>
<!-- spring 声明式事物 ,也可以用 tx 加 aop实现-->
<bean id="injMethodDAO" class="com.dao.InjMethodDao">
<property name="sqlMapClient">
<ref local="sqlMapClient" />
</property>
</bean>
<bean id="injMethodServer" class="com.server.InjMethodServer">
<property name="injMethodDao" ref="injMethodDAO"/>
</bean>
<!-- 事务代理拦截器的配置 -->
<bean id="baseTransactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="userDAOProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="injMethodDAO" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop><!-- 支持当前事务,如果当前没有事务,就新建一个事务 -->
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
</beans>
- spring ibatis 声明式事务 配置
- spring 配置声明式事务
- spring声明式事务配置
- spring声明式事务配置
- spring声明式事务配置
- spring声明式事务配置
- spring声明式事务配置
- Spring配置声明式事务
- spring+ibatis事务配置
- spring ibatis 配置事务
- spring+ibatis事务配置
- spring+ibatis事务配置
- spring+ibatis事务配置
- spring声明事务配置
- spring 声明式事务各种配置解析
- spring 声明式事务配置简洁法
- Spring结合Hibernate声明式事务配置
- Spring注解声明式事务配置
- DropDownList 数据绑定
- 快速排序
- kill -HUP pid
- 在浏览器中弹出模式对话框
- 浅析Java中CountDownLatch用法
- spring ibatis 声明式事务 配置
- C#二进制文件比较程序
- linux 机器配置查看
- 关于Linux内核学习(尚观Linux研究室)
- Qt Creator系列教程
- 使用Jakarta Commons Pool处理对象池化(zz)
- unix 常用命令
- 淘宝开店方法流程,如何尽快赚钱
- 构建WCF RESTful service示例