activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: XATransaction
Date Tue, 24 Apr 2007 00:04:07 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=us-ascii" 
format="flowed" plain; text Content-Type: 7bit Content-Transfer-Encoding:>
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<DIV dir=ltr align=left><SPAN class=995040100-24042007><FONT face=Arial 
color=#0000ff size=2>I'm currently using Bitronix Transaction Manager. (<A 
href=""></A>) It is an open source 
transaction manager that is extremely stable. (Unlike JOTM) It implements the 
JTA completely and is very easy to configure and integrate with Spring. Plus you 
will not need to using Jenks. BTM is a complete 
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Daniel Gradecak 
&lt;; [mailto:Daniel Gradecak &lt;;]

<BR><B>Sent:</B> Monday, April 23, 2007 2:06 PM<BR><B>To:</B><BR><B>Subject:</B> XATransaction<BR></FONT><BR></DIV>
<DIV></DIV>Hi, <BR><BR>I would like to make an ActiveMQ participate
in a XA 
Transaction. I have <BR>speial needs is that i may suspend a transaction and 
resume it in <BR>antoher thread. I am using spring for configuring all that 
together <BR>and its JmsTmplate. I saw 
<BR>and , that seems fine to me. But I 
<BR>thought I could use JTOM as TM. <BR>So maybe it is not the right place to

ask but I do not know where else :( <BR><BR>I would like to know if there is a

better solution to use XA with <BR>ActiveMQ because when I do a massive (never 
doing commit, just for test) <BR>rollback in my "transaction resuming threads" 
after one hour and a half <BR>of executing those threads (I am using Executors 
with a pool of 20 <BR>threads) I just receive java heap space. As I was using 
jencks/geronimo <BR>I tried the same with JTOM but the same happened. I am also 
using the <BR>new AMQPool from Jencks, because i do not know how else i could 
pool xa <BR>connections for activemq. I also saw an old thread speaking about 
<BR> but it seems it was 
<BR>moved to Jencks. <BR><BR>So please guys, is it better to use Jencks
or JTOM? 
<BR><BR>Here is my sample config ... <BR><BR><BEAN id=jmsResourceAdapter

<BR>class="org.apache.activemq.ra.ActiveMQResourceAdapter"&gt; <BR><property


<BR></BEAN><BR><BR><BEAN id=transactionManager 
<BR>class="org.jencks.factory.TransactionManagerFactoryBean"&gt; <BR><property


<BR></BEAN><BR><BR><BR><BEAN id=connectionFactory 

<BR><property ref="transactionManager" 

<BR></BEAN><BR><BR><BEAN class=org.springframework.jms.core.JmsTemplate

id=jmsTemplate><BR><property ref="connectionFactory" 

<BR></BEAN><BR><BR>*And the java suspend transaction code ...* 
<BR><BR>TextMessage m = (TextMessage)template.receive(queueName); <BR>if(
m != 
null){ <BR><BR>tx = tm.suspend(); <BR><BR>threadDisptacher.submit(new

TxThread(tm, tx, m)); <BR><BR>} else{ <BR>System.out.println("TIMEOUT :

<BR>"+Thread.currentThread().getId()); <BR>tm.rollback(); <BR>} <BR><BR>*And
TxThread when it starts it does ...* <BR><BR>try { <BR>tm.resume(tx); 
<BR><BR>System.out.println("&gt; SLEEP ... 
<BR>"+Thread.currentThread().getId()); <BR>try { <BR>Thread.sleep(10000);
catch (InterruptedException e) { <BR>} <BR>System.out.println("&gt; SLEEP
<BR>"+Thread.currentThread().getId()); <BR><BR>System.out.println(m); 
<BR><BR>tm.rollback(); <BR>} catch (Throwable e) { <BR>e.printStackTrace();

<BR>try { <BR>tm.rollback(); <BR>} catch (Throwable e1) { 
<BR>e1.printStackTrace(); <BR>} <BR>} <BR><BR>Sorry for this
<BR><BR>Kindly, <BR>Daniel <BR><BR></BODY></HTML>

View raw message