activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From balpeck <>
Subject Distributed Transaction using ActiveMQ/JOTM/JDBC
Date Sun, 11 Nov 2007 18:08:25 GMT

Hi everyone,
I am trying to get a distributed transaction going with JOTM as a
transaction manager and ActiveMQ and JDBC as participants in the distributed
transaction. I'm very new to both JOTM and ActiveMQ. 

As I understand it now,
I need to create a TransactionManager, get an XAResource for ActiveMQ and my
DBMS(Postgresql), enlist them, get a USerTransaction and do a begin and an
Is this roughly correct??

In am attempt of doing so.. I ran into a problem of the
connFac.createXAConnection() method not returning.It just hangs and returns
once I terminate the broker. Anything I may have missed?

import org.objectweb.jotm.Jotm;
import org.objectweb.transaction.jta.TMService;
import javax.transaction.*;
import javax.transaction.xa.*;
import org.apache.activemq.*;

public class TestXAJms
	static String user = ActiveMQConnection.DEFAULT_USER;
	static String password = ActiveMQConnection.DEFAULT_PASSWORD;
	static String url = ActiveMQConnection.DEFAULT_BROKER_URL;

	static public void main(String[]args)
			/// Get the transaction Manager
			Jotm jotm = new Jotm(true, false);
			TransactionManager tm = jotm.getTransactionManager();
			Transaction tx = tm.getTransaction();

			/// Try to get to the XAResource for ActiveMQ
			ActiveMQXAConnectionFactory connFac = new
			javax.jms.XAConnection xa_conn = connFac.createXAConnection();

		catch(Exception e)

I appreciate any pointers on how to get a distributed transaction involving
ActiveMQ going. 


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message