主要测试内容是两个线程同时对一个表操作时,后一个CCC类中的select之后commit,是否会对AAA类的insert操作rollback产生影响。测试结果是互不影响。
spring xml 配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- 数据源连接 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@192.168.0.203:1521:orcl</value>
</property>
<property name="username">
<value>YQZL</value>
</property>
<property name="password">
<value>YQZL</value>
</property>
</bean>
<!-- 事务处理 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local=&