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
大田斗
閱讀(3373)
評論(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
亞光
同云博客
小弟鵬
張玉磊
昕
李陽
黃鳴
搜索
積分與排名
積分 - 1104425
排名 - 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表格(2057)
評論排行榜
1.?北京戶口--吃官司(5)
2.?開始→運行→輸入的命令集錦(3)
3.?讓網頁上的所有圖片動起來(2)
4.?Dom4j 編碼問題徹底解決 (1)
5.?心情不爽(1)
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 大田斗
主站蜘蛛池模板:
在线免费观看中文字幕
|
天黑黑影院在线观看视频高清免费
|
亚洲综合AV在线在线播放
|
黄色a级免费网站
|
亚洲?v无码国产在丝袜线观看
|
国内永久免费crm系统z在线
|
亚洲视频人成在线播放
|
一级毛片视频免费观看
|
久久亚洲国产精品五月天婷
|
精品无码一级毛片免费视频观看
|
亚洲国产成人精品91久久久
|
一个人看的免费视频www在线高清动漫
|
免费h黄肉动漫在线观看
|
国产成人无码精品久久久久免费
|
亚洲国产AV无码专区亚洲AV
|
无码午夜成人1000部免费视频
|
亚洲综合网美国十次
|
成人毛片免费观看视频在线
|
亚洲AV无码一区二区三区鸳鸯影院
|
亚洲A∨午夜成人片精品网站
|
fc2免费人成在线视频
|
亚洲国产成人高清在线观看
|
18勿入网站免费永久
|
美女黄色免费网站
|
亚洲熟妇av一区二区三区漫画
|
97精品免费视频
|
亚洲avav天堂av在线网毛片
|
国外亚洲成AV人片在线观看
|
19禁啪啪无遮挡免费网站
|
亚洲熟妇久久精品
|
激情综合色五月丁香六月亚洲
|
99re在线精品视频免费
|
亚洲第一街区偷拍街拍
|
久久久久一级精品亚洲国产成人综合AV区
|
成熟女人特级毛片www免费
|
日韩免费码中文在线观看
|
亚洲av不卡一区二区三区
|
日本免费电影一区
|
久久久久久久99精品免费观看
|
国产精品亚洲一区二区麻豆
|
国产亚洲美女精品久久久2020
|