Differences between Datasource and XADatasource
来源:互联网 发布:四川广电电视网络套餐 编辑:程序博客网 时间:2024/05/17 01:28
You need an XADataSource if you want to execute a Distributed Transaction. You should use XADataSource instead of DataSource if the application
1. Uses the Java Transaction API (JTA)
2. Includes multiple database updates within a single
transaction
3. Accesses multiple resources, such as a database and the
Java Messaging Service (JMS), during a transaction
1. Uses the Java Transaction API (JTA)
2. Includes multiple database updates within a single
transaction
3. Accesses multiple resources, such as a database and the
Java Messaging Service (JMS), during a transaction
4. Use the same connection pool on multiple servers
An XA transaction, in the most general terms, is a "global transaction" that may span multiple resources. A non-XA transaction always involves just one resource. An XA transaction involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global transaction. Non-XA transactions have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions). XA transactions come from the X/Open group specification on distributed, global transactions. JTA includes the X/Open XA spec, in modified form. Most stuff in the world is non-XA - a Servlet or EJB or plain old JDBC in a Java application talking to a single database. XA gets involved when you want to work with multiple resources - 2 or more databases, a database and a JMS connection, all of those plus maybe a JCA resource - all in a single transaction. In this scenario, you'll have an app server like Websphere or Weblogic or JBoss acting as the Transaction Manager, and your various resources (Oracle, Sybase, IBM MQ JMS, SAP, whatever) acting as transaction resources. Your code can then update/delete/publish/whatever across the many resources. When you say "commit", the results are commited across all of the resources. When you say "rollback", _everything_ is rolled back across all resources. The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources. In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. A non-XA datasource generally can't participate in a global transaction (sort of - some people implement what's called a "last participant" optimization that can let you do this for exactly one non-XA item).Read more: http://wiki.answers.com/Q/Differences_between_XA_and_Non_XA_Data_sources#ixzz2hrsXJLiO
- Differences between Datasource and XADatasource
- Differences Between Unix and Windows
- Differences between Hibernate and NHibernate
- Differences between C++ and Java
- Differences Between innodb_data_file_path and innodb_file_per_table
- Differences between WM_NOTIFY and WM_COMMAND
- Differences between HashMap and Hashtable
- differences between ATM and Ethernet
- Differences Between Heuristics and Metaheuristics
- Differences Between PyQt4 and PyQt5
- Differences between hashmap and hashtable
- differences between Proxy and vpn
- Differences between UDID and UUID
- Differences between ArrayList and Vector
- Differences between Octave and MATLAB
- Differences Between FTP and TFTP
- Differences between interrupts and traps
- differences between zephyr and riot.
- JFreeChart用法
- flex 组件显示手型 光标
- svn回滚操作(撤销修改)
- ios 绘图
- 指针 数组
- Differences between Datasource and XADatasource
- solr data-config.xml配置文件的见解mysql数据源
- qt5 deploy 部署 双击 myProgram.exe时 提示找不着 ...windows 不能运行
- 让我们摸清楚多表连接的原理
- Spring 3 Ioc 容器装在bean
- 谈学习和比较
- android view或button的setVisibility方法值的意思
- VC++中List Control控件的使用方法介绍
- 不通尺寸的手机,文字大小设置