activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kawasaki <xenhalfl...@gmail.com>
Subject Manual XA transaction management
Date Sun, 03 Feb 2008 16:17:11 GMT

Hello all,

I am trying to do the following:

-the action of receiving the JMS message to participate in XA transaction
 (I want receive via MessageListener.onMessage to be atomic with save in
  Xa capable database; receive message and save it in my cusomt database).

I have scanned AMQ source code, test cases and so on, have googled but cant
figure out how to do this, and if this is actually possible. 

Here are detailed thoughts:

I need to manually control transaction, so I will manuall call begin()
and commit() of the UserTransaction object.

So if one would be doing this in typical web app scenario, such as
simple Tomcat deployment, thread started by Tomcat upon receiving request
would call some method I define, and that method would contain
manual transaction logic. 

When using AMQ same would happen if using asynchronous delivery 
(onMessage), client side part of AMQ would call from his thread 
onMessage() method of my listener.

The things I cant figure out, is how to inject manual begin() and
end() of transaction in this case, since when AMQ cliend side thread
call onMessage(), I assume transaction is already started.
If I put begin() in onMessage method, it seems it violated tx
semantics, at least to me with my current limited knowledge on
this matter.

I am really confused about this part now, and would really appreciate
any links/tips how to figure out how this works.

Thanks in advance
-- 
View this message in context: http://www.nabble.com/Manual-XA-transaction-management-tp15254969s2354p15254969.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message