|
Problem |
This technote explains when you should use an XA
datasource and when you should use a non-XA datasource. |
|
Solution |
An XA datasource is sometimes described as two-phase
commit (2PC) because that is the mechanism used to implement the Atomic,
Consistent, Isolated, Durable (ACID) properties of a transaction with
multiple resources.
If multiple connections to a database or more than one transactional
resource is accessed in a transaction, an XA datasource must be used.
WebSphere® Application Server's connection sharing optimization makes it
unnecessary to use 2PC if all the following criteria are met:
- Connections all made from the same Java™ Virtual Machine
(JVM™)
- Connections all made from the same datasource
- Connections all made using the same username and
password
If any of these constraints are violated, a 2PC datasource must be used.
In other words, if any of the following are true, a 2PC datasource must
be used:
- There are connections from two or more datasources (both
must be 2PC)
- There are two or more JVMs making connections
- The connections come from the same datasource, but with
different credentials
|
|
|
|
|
|
|