Hi Tom

----- Original Message -----
From: "Tom Marsh" <[EMAIL PROTECTED]>
> 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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to