[jboss-dev-forums] [JBoss AS 7 Development] - Two-phase commit using an XA-datasource

Bohuslav Jecmen do-not-reply at jboss.com
Thu Dec 6 16:34:48 EST 2012


Bohuslav Jecmen [https://community.jboss.org/people/jecmenb] created the discussion

"Two-phase commit using an XA-datasource"

To view the discussion, visit: https://community.jboss.org/message/780509#780509

--------------------------------------------------------------
Howdy!
I'd like to ask a question about using an xa-datasource defined within my AS7 instance. 
*What I did:* I defined two different xa-datasources pointing to two databases
*What I need:* I need to implement a two phase commit using those two xa-datasources mentioned above.

Is there any Java sample/example how to use the JBoss transactional mechanism to do what I need? 
As I understood, I can (I have to) use an ordinary DataSource instead of XADataSource in my code, right? How does it work? What is the right way to do following:
1. Create two connections to 2 different DBs (using xa-datasources defined within my AS7)
2. Do some operations over both of them
3. Do a final commit (or rollback if any error)

Last question - what's the role of the JBoss's TransactionManager? How does it work? Is it hidden for the developers or do we need to instantiate it explicitly?

Since I didn't found any sufficient answer I appreciate any explanation and help!

Thanks a lot,
Bobo
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/780509#780509]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121206/f8909f56/attachment.html 


More information about the jboss-dev-forums mailing list