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
大田斗
閱讀(3365)
評論(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年5月
>
日
一
二
三
四
五
六
27
28
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
導航
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
亞光
同云博客
小弟鵬
張玉磊
昕
李陽
黃鳴
搜索
積分與排名
積分 - 1101556
排名 - 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.?網頁不緩存(3552)
2.?Form嵌套引起的問題 (2850)
3.?解決IE下CSS背景圖片閃爍的Bug(2445)
4.?Spring AOP的動態載入原理(2403)
5.?如何制作漂亮的Excel表格(2044)
評論排行榜
1.?北京戶口--吃官司(5)
2.?開始→運行→輸入的命令集錦(3)
3.?讓網頁上的所有圖片動起來(2)
4.?Dom4j 編碼問題徹底解決 (1)
5.?心情不爽(1)
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 大田斗
主站蜘蛛池模板:
亚洲精品国产免费
|
国产精品亚洲玖玖玖在线观看
|
亚洲国产精品网站在线播放
|
日韩插啊免费视频在线观看
|
亚洲fuli在线观看
|
亚洲?v女人的天堂在线观看
|
日韩免费人妻AV无码专区蜜桃
|
亚洲欧美日韩中文二区
|
亚洲精品无码久久久久
|
在线播放免费人成视频在线观看
|
国产免费MV大全视频网站
|
亚洲日日做天天做日日谢
|
亚洲综合色婷婷七月丁香
|
成人午夜视频免费
|
午夜精品免费在线观看
|
一级一黄在线观看视频免费
|
亚洲字幕在线观看
|
亚洲中文字幕无码日韩
|
午夜一级免费视频
|
中文字幕免费在线
|
国产精品无码免费专区午夜
|
亚洲人成77777在线观看网
|
亚洲AV无码精品色午夜在线观看
|
免费jjzz在在线播放国产
|
国产日本一线在线观看免费
|
a成人毛片免费观看
|
国产亚洲精品美女久久久久久下载
|
亚洲第一网站免费视频
|
亚洲自偷自偷在线制服
|
国产成人免费手机在线观看视频
|
国产成人精品日本亚洲语音
|
亚洲性69影院在线观看
|
欧洲亚洲国产清在高
|
免费国产怡红院在线观看
|
99视频在线精品免费观看6
|
一级毛片成人免费看免费不卡
|
sihu国产精品永久免费
|
99亚洲精品卡2卡三卡4卡2卡
|
亚洲AV综合色区无码二区爱AV
|
久久久无码精品亚洲日韩蜜臀浪潮
|
拔擦拔擦8x华人免费久久
|