日期:2014-05-17 浏览次数:20835 次
<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"/> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransaction"><ref local="jotm"/></property> </bean> <bean id="mysqlDataSource1" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager"><ref local="jotm"/></property> <property name="driverName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://localhost:3306/emp_mvc</value></property> <property name="user" value="root"/> <property name="password" value="123456"/> </bean> <bean id="dataSource1" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="shutdown"> <property name="dataSource"><ref local="mysqlDataSource1"/></property> <property name="maxSize"><value>5</value></property> <property name="minSize"><value>2</value></property> <property name="user"><value>root</value></property> <property name="password"><value>123456</value></property> </bean> <bean id="mysqlDataSource2" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager"><ref local="jotm"/></property> <property name="driverName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://localhost:3306/emp_mvc2</value></property> <property name="user" value="root"/> <property name="password" value="123456"/> </bean> <bean id="dataSource2" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="shutdown"> <property name="dataSource"><ref local="mysqlDataSource2"/></property> <property name="maxSize"><value>5</value></property> <property name="minSize"><value>2</value></property> <property name="user"><value>root</value></property> <property name="password"><value>123456</value></property> </bean> <bean id="sessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource1"/> <property name="mappingResources"> <list> <value>com/ouku/JOTM/entity/Emp.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SybaseDialect</prop> <prop key="hibernate.show_sql">