-
1. Re: Two-phase commit using an XA-datasource
mmusgrov Dec 6, 2012 5:35 PM (in response to jecmenb)1 of 1 people found this helpfulThe AS7 quickstarts (https://github.com/jboss-jdf/jboss-as-quickstart) have some transactions examples including how to update two datasources within a single transaction (look for CMT, BMT, jts and the crash-rec examples).
It is possible to enlist a single non-XA aware datasource (search for LRCO for details) but we don't support it since it is not a recommended configuration.
The transaction manager is initialised by the AS so you don't create it yourself. Normally you would use the EJB mechanisms for controlling transactions - the quickstarts cover both bean managed and container managed transactions. If you really want to get hold of the transaction manager you can look it up via JNDI (but the name is not standardised by the specifications, I believe AS7 uses java:jboss/TransactionManager).
-
2. Re: Two-phase commit using an XA-datasource
jecmenb Dec 7, 2012 2:47 AM (in response to mmusgrov)Hey, Michael
Great, thanks for the very quick reply.
So the right way is to implement a SessionBean encapsulating let say both of my SQL inserts (for instance), right?
Thanks again for your answer.
Cheers,
Bobo
-
3. Re: Two-phase commit using an XA-datasource
atijms Dec 23, 2012 3:29 PM (in response to mmusgrov)If you really want to get hold of the transaction manager you can look it up via JNDI (but the name is not standardised by the specifications, I believe AS7 uses java:jboss/TransactionManager).
It indeed isn't standardized. I've created a spec issue some time ago to standardize this. If you, or anyone else thinks this is important too, please vote for it at: http://java.net/jira/browse/JAVAEE_SPEC-8
The issue with those names being not standardized is not even so much that they differ between application servers of different vendors, but that they differ between versions of the same AS (e.g. JBoss AS 6 vs JBoss AS 7).