Version 6

    Use of an XA datasource with JBM

     

    JBoss Messaging fully provides an XA interface so JMS operations can be enlisted in a global transaction.

     

    JBM implements the XAResource functionality internally, and does not rely on any database's XA implementation for implementing this functionality.

     

    Therefore, JBM should always be configured with a standard transactional (non XA) database datasource.

     

    Please note that just because JBM does not use the database's XA functionality, this does not in any way prevent JBM from implementing it's own XA functionality fully.

     

    You can still enlist JBM as a resource in a global transaction, along with another XA resource (e.g. a database) and maintain proper global transaction semantics.

     

    E.g. in a transactional MDB, you might want to send a JMS message via JBM and update a row in an Oracle database in the same global transaction.

     

    In this case you would make sure you looked up your JMS connection factory using the JMS JCA resource adaptor (typically at java:/JmsXA), and use an XA datasource for your connection that inserts the row in Oracle - note that you would not configure an XA datasource for the datasource that JBM uses internally for persisting it's data.

     

    In that example you would have two datasources:

     

    1. An XA datasource for the connection to Oracle (nothing to do with JBM) that you will use to insert your row in the database.

    2. A non XA datasource configured for JBM to use to internally persist its data.

     

    Some related posts:

     

    http://www.jboss.org/index.html?module=bb&op=viewtopic&t=119217

     

    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116970#4116970