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高清无码
|
亚洲av无码专区在线
|
久久亚洲欧美国产精品
|
精品国产免费一区二区三区香蕉
|
全免费毛片在线播放
|
亚洲精品成人无限看
|
亚洲Av永久无码精品黑人
|
成人影片麻豆国产影片免费观看
|
亚洲精品国产精品乱码不99
|
中国一级特黄高清免费的大片中国一级黄色片
|
97se亚洲国产综合自在线
|
波霸在线精品视频免费观看
|
国产国拍亚洲精品福利
|
亚洲精品久久无码
|
久久国产免费福利永久
|
亚洲尤码不卡AV麻豆
|
爱爱帝国亚洲一区二区三区
|
麻豆视频免费观看
|
国产成人亚洲精品
|
国产又粗又猛又爽又黄的免费视频
|
亚洲精品美女在线观看播放
|
两个人看www免费视频
|
免费一看一级毛片
|
亚洲中文字幕一区精品自拍
|
色片在线免费观看
|
亚洲欧洲在线观看
|
91视频免费网站
|
亚洲国产精品久久
|
九九九精品成人免费视频
|
男女男精品网站免费观看
|
日韩伦理片电影在线免费观看
|
国产婷婷综合丁香亚洲欧洲
|
国产精品免费播放
|
日本免费A级毛一片
|
亚洲人成人一区二区三区
|
91av免费观看
|
久久国产亚洲高清观看
|
午夜影院免费观看
|
亚洲国产美国国产综合一区二区
|
日本XXX黄区免费看
|