Hello list,
We've been trying to use, transaction aware queues with no success..
The problem is that messages always get sent, inspite of rollbacks.
We don't know if it is our fault or this type of queues don't work properly
in Orion.

Here is a snip of our configuration and what we are doing.

-----------------------------------------------------------------------------------
jms.xml:
     <xa-topic-connection-factory location
="jms/observerConnectionFactory"/>
     <topic name="Observer" location="jms/observer">
     </topic>
-----------------------------------------------------------------------------------
/** Some session bean's method */

UserTransaction transaction = ctx.getUserTransaction();
transaction.begin();
sendMessage();
transaction.rollback();

-----------------------------------------------------------------------------------

/**
   Inside the sendMessage method.
   We have tryied to use Topic and Queue types.
*/


Topic                    topic = null;
 XATopicSession          session = null;
 XATopicConnection       connection = null;
 XATopicConnectionFactory     connectionFactory = null;
 TopicPublisher               publisher;

 InitialContext  initialContext = new InitialContext ();

connectionFactory = (XATopicConnectionFactory) initialContext.lookup
("java:comp/env/jms/observerConnectionFactory");
topic = (Topic) initialContext.lookup ("java:comp/env/jms/observer");

initialContext.close ();

connection = connectionFactory.createXATopicConnection ();
connection.start ();
session = connection.createXATopicSession ();
publisher = session.getTopicSession ().createPublisher (topic);

Message message = session.createMessage ();

message.setStringProperty ("str", event.getSource ().toString ());
publisher.publish (message);
session.close ();
connection.close ();

-----------------------------------------------------------------------------------

Ramiro Diaz Trepat
Opetra


Reply via email to