commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Commons Messenger - How to set 'Transacted' to true?
Date Mon, 29 Apr 2002 17:16:44 GMT
Hi Tom

----- Original Message -----
From: "Tom Marsh" <>
> 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


Do You Yahoo!?
Get your free address at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message