Well, hopefully I won't make you permanently confused ;-)
IMHO the best documentation is the chapter (3?) in the manual on Using Databases and other Enterprise Resources and the jca spec (from sun)
The way the XADataSourceLoader in 2.4.x works is pretty similar to the jca spec way, just not conforming to a spec as well.
The DataSource (ConnectionFactory) is just where you get your connections from. From the app point of view, you don't need to know where they come from. From the app server point of view, you want to pool and reuse them.
There is normally one pool per DataSource, and always one DataSource per pool. It is possible by specifying per-subject pool to get a pool for each Subject logging into the Resource Manager (db). The configuration is by DataSource (ConnectionFactory) so there is no way to get 2 datasources sharing a pool... whatever that might mean.
If you have several datasources on one database, they can't share a pool. You will also need an xa driver to get real transactions that span both datasources.
There are 2 aspects to distributed (xa) transactions: a transaction on one machine using 2 or more Resource Managers (databases), which requires xa drivers for all the Resource Managers, and uses two phase commit, and transactions that span several server (jboss) instances (in separate vms). The first kind is handled by the default jboss transaction manager, for the second you need the tyrex tm.
no longer confused, thanks david
I'm confused too!!! The documentation online it's not good!!!
Please help me too!!