BaoYaEr
spring+atomikos+JTA完整例子
jotm真是個爛東西,不能回滾,導致系統出現了很多問題,深受其害,決心換個東東,在網上找到了atomikos,做下記錄
<?
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
>
發表于 2008-06-18 14:54
大田斗
閱讀(3372)
評論(2)
編輯
收藏
所屬分類:
spring
、
開源opensource
評論
#
re: spring+atomikos+JTA完整例子
謝謝分享
步萬里
評論于 2011-01-24 09:49
回復
更多評論
#
re: spring+atomikos+JTA完整例子
不錯,謝謝分享
張君元
評論于 2013-11-01 10:33
回復
更多評論
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
maven 的配置收藏
spring 事務詳解,非常不錯的一篇文章,留存
spring代碼分析【轉】
解惑 spring 嵌套事務
Spring2.5注釋語法
Quartz 在Spring中動態設置cronExpression [zt]
spring+atomikos+JTA完整例子
spring+hibernate的clob大字段處理(轉載于javaeye論壇)
通用Dao 設計 2
spring +hibernate 啟動優化【轉】
<
2025年7月
>
日
一
二
三
四
五
六
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
導航
BlogJava
首頁
發新隨筆
發新文章
聯系
聚合
管理
統計
隨筆: 32
文章: 427
評論: 144
引用: 0
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(5)
給我留言
查看公開留言
查看私人留言
隨筆檔案
2008年12月 (1)
2008年4月 (2)
2008年2月 (1)
2008年1月 (1)
2007年12月 (3)
2007年11月 (1)
2007年10月 (3)
2007年7月 (2)
2007年6月 (1)
2007年4月 (2)
2007年3月 (3)
2007年2月 (5)
2007年1月 (3)
2006年12月 (4)
文章分類
axis(6)
(rss)
eclipse(7)
(rss)
Hibernate(30)
(rss)
html/js/css(107)
(rss)
java(106)
(rss)
linux(7)
(rss)
Lucene(7)
(rss)
spring(36)
(rss)
Spring CLOUd(1)
(rss)
Strtus(30)
(rss)
其它(48)
(rss)
開源opensource(48)
(rss)
數據庫DateBase(30)
(rss)
設計模式(12)
(rss)
文章檔案
2018年8月 (1)
2012年5月 (1)
2012年4月 (2)
2011年7月 (6)
2010年3月 (1)
2010年2月 (1)
2010年1月 (3)
2009年12月 (1)
2009年10月 (1)
2009年8月 (3)
2009年3月 (1)
2009年2月 (1)
2008年12月 (3)
2008年11月 (10)
2008年10月 (3)
2008年9月 (2)
2008年8月 (2)
2008年7月 (4)
2008年6月 (13)
2008年5月 (15)
2008年4月 (9)
2008年3月 (10)
2008年1月 (18)
2007年12月 (33)
2007年11月 (6)
2007年10月 (18)
2007年9月 (10)
2007年8月 (18)
2007年7月 (15)
2007年6月 (25)
2007年5月 (19)
2007年4月 (26)
2007年3月 (38)
2007年2月 (33)
2007年1月 (27)
2006年12月 (27)
2006年11月 (12)
java
Ajax特效網站
cndiy nio
GRO
Hani Suleiman's blog
Java之路
java論壇
J道
mule
mule 入門
oksonic(動畫教程)
一路由你
中國eclipse
八進制
在線源碼
多線程實戰
天火
小米的blogjava
幻境伯克----jface/swt
很全的博克-強
每日一得
滿江紅
邢紅瑞
飛翔
鳥詩選(js)
鳥食軒 (dhtml)
工具
apache中文手冊
extjs學習
iconFindre
java 安全
javaresearch
java技巧網
js之王
matrix(study)
prototype api
spring中文
北京IT企業速查
在線流程圖工具
雅虎翻譯
朋友
Happyshow
hibernate異常
skywalker
sunshow
xf
亞光
同云博客
小弟鵬
張玉磊
昕
李陽
黃鳴
搜索
積分與排名
積分 - 1104403
排名 - 28
最新評論
1.?re: hibernate.cfg.xml配置
好全啊 .. 棒棒噠 ~ !
--junqinag.yang
2.?re: Quartz任務調度快速入門
我現在來看還是覺得不錯
--小任
3.?re: js中this的總結
評論內容較長,點擊標題查看
--pam
4.?re: Quartz任務調度快速入門
樓主辛苦
--yd
5.?re: Quartz任務調度快速入門
頂了,內容寫的很好
--sen
閱讀排行榜
1.?網頁不緩存(3563)
2.?Form嵌套引起的問題 (2867)
3.?解決IE下CSS背景圖片閃爍的Bug(2458)
4.?Spring AOP的動態載入原理(2416)
5.?如何制作漂亮的Excel表格(2056)
評論排行榜
1.?北京戶口--吃官司(5)
2.?開始→運行→輸入的命令集錦(3)
3.?讓網頁上的所有圖片動起來(2)
4.?Dom4j 編碼問題徹底解決 (1)
5.?心情不爽(1)
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 大田斗
主站蜘蛛池模板:
69av免费观看
|
亚洲精品无码久久久久牙蜜区
|
97公开免费视频
|
亚洲情A成黄在线观看动漫软件
|
国产无遮挡又黄又爽免费视频
|
久久亚洲AV无码精品色午夜
|
欧美在线看片A免费观看
|
成人在线免费视频
|
亚洲美女视频网站
|
亚洲 另类 无码 在线
|
最近免费mv在线电影
|
日本特黄特色AAA大片免费
|
亚洲欧洲国产成人精品
|
亚洲精品偷拍视频免费观看
|
四虎在线最新永久免费
|
国产精品hd免费观看
|
亚洲精品国产国语
|
亚洲国产成人久久精品动漫
|
免费一级毛片不卡不收费
|
免费无码VA一区二区三区
|
黄色免费网站在线看
|
亚洲免费二区三区
|
亚洲va中文字幕无码久久
|
国产成人在线免费观看
|
99无码人妻一区二区三区免费
|
a级毛片免费高清视频
|
亚洲欧好州第一的日产suv
|
亚洲国产精品自在在线观看
|
亚洲成网777777国产精品
|
搡女人真爽免费视频大全
|
99re6热视频精品免费观看
|
午夜在线免费视频
|
免费国产在线观看
|
7723日本高清完整版免费
|
永久免费av无码网站yy
|
国产一区二区三区亚洲综合
|
亚洲日本人成中文字幕
|
久久久久久亚洲精品成人
|
色噜噜亚洲精品中文字幕
|
亚洲国产电影av在线网址
|
在线永久免费观看黄网站
|