You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by kawasaki <xe...@gmail.com> on 2008/02/03 17:17:11 UTC

Manual XA transaction management

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.


Re: Manual XA transaction management

Posted by Rob Davies <ra...@gmail.com>.
On Feb 3, 2008, at 10:33 PM, kawasaki wrote:

>
> And of course http://jencks.codehaus.org/.
> -- 
> View this message in context: http://www.nabble.com/Manual-XA-transaction-management-tp15254969s2354p15259371.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Glad you found those!

cheers,

Rob

Rob Davies
'Go further faster with Apache Camel!'
http://rajdavies.blogspot.com/




Re: Manual XA transaction management

Posted by kawasaki <xe...@gmail.com>.
And of course http://jencks.codehaus.org/.
-- 
View this message in context: http://www.nabble.com/Manual-XA-transaction-management-tp15254969s2354p15259371.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Manual XA transaction management

Posted by kawasaki <xe...@gmail.com>.
Solved.

http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/jms/listener/DefaultMessageListenerContainer.html
-- 
View this message in context: http://www.nabble.com/Manual-XA-transaction-management-tp15254969s2354p15259049.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.