XA does generally exact a performance penalty. In non-XA operations, typically there's only one commit that does any signficant amount of work - the RDBMS commit. In XA, you end up with each "Resource Manager" (JMS, RDBMS, etc) commiting, and the Transaction Manager (the app server) also having to keep track of transactions.


In XA mode, the TM and each RM needs to have a transaction log, and typically the following happens:


- App or container asks for commit

- Foreach Resource:


- Call resource prepare - results in "hardening" of data and a disk force

- If all resources voted "yes", TM writes a prepared record to its tran log (also a disk force)

- Foreach Resource:

- Call resource commit - results in a disk force and data is committed

- "soft write" by the TM that the commit is complete (e.g. write w/ no disk force).


If you have two resources, such as your case (JMS and RDBMS), there are five disk forces involved (2 for JMS, 2 for RDBMS, 1 for TM).


The overhead will vary tremendously depending on the environment you're in and the products you're using, but it's often on the order of 50 milliseconds-100 milliseconds on average.


As an earlier thread on TSS indicated, on the JMS side not all JMS providers disk sync by default - they soft write without guaranteeing that data has been written to disk. This may be why you're not seeing as great of a performance hit - check your JMS providers' docs for details on "disk syncing" or "disk forcing" or "synchronized writes". Note also that some JMS providers don't use a transaction log at all, such as JBoss' JMS provider. And some JMS providers get it partially write - for example, one commercial JMS provider only durably records transactions for persistent messages, and (incorrectly) leaves transactions involving non-persistent messages hanging in the breeze.


For providers which have a log but don't disk force, a hard failure of the server (process or machine) can result in lost transactions. For providers which don't have transaction logs at all, the server can't preserve transactions across startup/shutdown of the JMS server at all.


On the TM side, Websphere versions 4.x and 5.x definitely involve a disk force when all resources are prepared. I don't remember what JBoss does.