简体   繁体   中英

How to do XA transaction which includes JDBC and JMS transactions?

I need to do XA transaction in JavaSE with JDBC and JMS Queues.

I have weblogic server to lookup for resources.

Could you help me with some sample code?

I can't provide code, but you must keep these things in mind when doing two-phase commit with JDBC and JMS resources in WebLogic...

  • Configure the JMSconnection factory to use: weblogic.jms.XAConnectionFactory

More info: http://docs.oracle.com/cd/E13222_01/wls/docs103/ConsoleHelp/pagehelp/JMSjmsconnectionjmsconnectionfactoryconfigtransactionparamstitle.html

  • Configure JDBC connection pool to use XA-compliant JDBC driver.

From the code perspective, either control the transaction from MDB or Spring bean with transaction annotations; the J2EE containers will handle the global commit/rollback.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM