spring+atomikos+JTA完整例子
来源:互联网 发布:交友软件有哪些 编辑:程序博客网 时间:2024/06/04 18:04
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"><beans default-autowire="byName" > <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> </bean> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close"> <!-- when close is called, should we force transactions to terminate or not? --> <property name="forceShutdown"><value>true</value></property> </bean> <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager"><ref bean="atomikosTransactionManager" /></property> <property name="userTransaction"><ref bean="atomikosUserTransaction"/></property> </bean> <bean id="auditDS" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close"> <property name="uniqueResourceName"><value>mysql/cnaudit</value></property> <property name="xaDataSourceClassName"> <value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</value> </property> <property name="xaProperties"> <props> <prop key="user">XXX</prop> <prop key="password">XXX</prop> <prop key="URL"> XXX </prop> </props> </property> <property name="poolSize"><value>50</value></property></bean> <bean id="oracleDS" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close"> <property name="uniqueResourceName"><value>oracle/cnaudit</value></property> <property name="xaDataSourceClassName"> <value>oracle.jdbc.xa.client.OracleXADataSource</value> </property> <property name="xaProperties"> <props> <prop key="user">XXX</prop> <prop key="password">XXX</prop> <prop key="URL"> XXX </prop> </props> </property> </bean> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="classpath:ibatis/SqlMapConfig.xml" /> <property name="dataSource" ref="auditDS" /> </bean> <bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"/> <bean id="oraSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="classpath:ibatis/SqlMapConfig-oracle.xml" /> <property name="dataSource" ref="oracleDS" /> </bean> <bean id="oraSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> <property name="sqlMapClient" ref="oraSqlMapClient" /> </bean></beans>
在配置一下事物管理,ok
<?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" default-autowire="byName" default-lazy-init="true"> <!-- 支持 @AspectJ 标记--> <aop:aspectj-autoproxy/> <aop:config proxy-target-class="true"> <aop:advisor pointcut="execution(* *Facade.*(..))" advice-ref="txAdvice"/> <aop:advisor pointcut="execution(* *Manager.*(..))" advice-ref="txAdvice"/> </aop:config> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="get*" read-only="true"/> <tx:method name="find*" read-only="true"/> <tx:method name="has*" read-only="true"/> <tx:method name="locate*" read-only="true"/> <tx:method name="*"/> </tx:attributes> </tx:advice> </beans>
- spring+atomikos+JTA完整例子
- spring+jta+atomikos
- 分布式事务入门例子(Spring+JTA+Atomikos+Hibernate+JMS)
- Spring JTA应用JOTM & Atomikos
- Spring JTA应用JOTM & Atomikos
- Spring JTA应用JOTM & Atomikos
- java事务学习笔记(八)--分布式事务入门例子(Spring+JTA+Atomikos+Hibernate+JMS)
- java事务全解析(八)--分布式事务入门例子(Spring+JTA+Atomikos+Hibernate+JMS
- Spring+iBatis+Atomikos实现JTA事务
- Spring全局事务之JTA+Atomikos
- 分布式事务JTA之实践:Spring+ATOMIKOS
- Spring+iBatis+Atomikos实现JTA事务
- JTA/XA: Atomikos + Spring + Hibernate 配置 注意事项
- 分布式事务JTA之实践:Spring+ATOMIKOS
- Spring+iBatis+Atomikos实现JTA事务
- Spring+iBatis+Atomikos实现JTA事务
- Spring+iBatis+Atomikos实现JTA事务
- Spring全局事务之JTA+Atomikos
- java类Timer和TimerTask的使用
- window.showModalDialog刷新父页面的问题
- wireshark的使用教程--用实践的方式帮助我们理解TCP/IP中的各个协议是如何工作的
- Android所有的权限注解
- system.img的windows浏览器
- spring+atomikos+JTA完整例子
- 常用日期函数
- samba
- C调用C++链接库
- Android网络访问请求方式
- python struct模块应用.数据转换换成二进制流
- 趣题:老鼠与毒药问题的推广
- 使用ActionScript实现滤镜效果
- socket ( java ) 简单客户端、服务端通信