You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tom Marsh <ma...@nitesco.com> on 2002/04/26 17:47:28 UTC

Commons Messenger - How to set 'Transacted' to true?

All:

I'm trying to use messenger.rollback() when I have a problem, but JMS 
complains that I'm not transacted. I was trying to figure out how to 
set it in messenger.xml, but couldn't. (Using MqSeries JMS). I hard 
coded transaction to true in sessionfactory. I'm thinking I could set 
up for it in MessengerDigester, but I'm a little over my head......

Any ideas?

TIA

Tom Marsh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Commons Messenger - How to set 'Transacted' to true?

Posted by James Strachan <ja...@yahoo.co.uk>.
Hi Tom

----- Original Message -----
From: "Tom Marsh" <ma...@nitesco.com>
> All:
>
> I'm trying to use messenger.rollback() when I have a problem, but JMS
> complains that I'm not transacted. I was trying to figure out how to
> set it in messenger.xml, but couldn't. (Using MqSeries JMS). I hard
> coded transaction to true in sessionfactory. I'm thinking I could set
> up for it in MessengerDigester, but I'm a little over my head......

You're right its all to do with getting the MessengerDigester to create the
correctly configured JMS Connection / Sessions for you.

One way to do it is to use whatever tools come with your J2EE app server or
JMS implementation and create JNDI administered objects, then just look up
your connection factories via JNDI

  <messenger name="topic" jndiDestinations="true">
    <jndi lookupName="TopicConnectionFactory" topic="true">
    ...

There are various things relating to transactions and rollbacks here.

JMS can operate in a 'transacted' mode. To enable transacted mode you just
need to use a 'transacted' attribute in the factory element....

  <messenger name="foo">
    <factory transacted="true" >

Or you could write your own SessionFactory class to create
connections/sessions however you wish. For example it might well make sense
to write an XASessionFactory to create XAConnection and XASessions. Then you
could use it as follows...

  <messenger name="foo">
    <factory className="org.apache.commons.messenger.XASessionFactory">
...

Then you could use your JMS provider in an XA (2 phase commit) manner.

Probably working in 'transacted' mode might work for you; otherwise using
your own factory might be better or trying the administered objects / JNDI
route.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>