jboss数据源配置
http://blog.csdn.net/clinique/article/details/7482670
最近項目相關的JBOSS配置開始,留下點什么
?
項目使用的是local-tx-datasource, 網上找了很多資料,都沒有明確說明local-tx-datasource和xa-datasource的區(qū)別,而且中文的資料太少,去JBOSS Community 查看了一圈找到了有價值的信息。
JBOSS Administration_Configuration_Guide上的解釋
<no-tx-datasource>
Does not take part in JTA transactions. The?Java.sql.Driveris used.
?
<local-tx-datasource>
Does not support two phase commit. The java.sql.Driveris used. Suitable for a single database or a non-XA-aware resource.
?
<xa-datasource>
Supports two phase commit. The javax.sql.XADataSourcedriver is used.
?
說的比較清楚,local-tx-datasource是可以作為JTA事務參與者的, 只是不支持2PC協(xié)議(two-Phase-Commit Protocol)。
?
?
在Forum上到的討論結果,JBOSS的開發(fā)人員認證了一下說法
You have to usexa-datasources in cases where?onetransaction spans multiple datasources. Regardless of wheter Iuse a cluster or not.
?
?
For example amethod consuming a JMS message and manipulating a JPA Entity.
?
對這個說法的解釋就是,一個Application可以定義并使用很多個local-tx-datasource數(shù)據(jù)源,但是一個事務(Transaction)只能操作一個數(shù)據(jù)源。當你的事務需要同時處理不同的數(shù)據(jù)源的時候,必須定義為xa-datasource,否則會出現(xiàn)org.jboss.util.NestedSQLException:Could not enlist in transaction on entering meta-aware object 的報錯。
轉載于:https://www.cnblogs.com/jiaozi-li/p/7308239.html
總結
以上是生活随笔為你收集整理的jboss数据源配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手机步数怎么清零?
- 下一篇: 创建虚拟环境和新建工程目录