WebSphere Application Server - JMS transactions and session beans

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > February 2004 > JMS transactions and session beans





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JMS transactions and session beans
Mark

2004-02-16, 8:33 am

Hi

I am performing the following:
- Call a Session EJB method
- In this method I am placing some messages on a JMS queue
- Invoking rollback on the bean (getSessionContext().setRollbackOnly();)
- The messages are removed from the queue as part of the rollback.

My question is:
I have tried creating the JMS session using both true and false as the
transacted attribute. In both cases the messages are removed on rollback.
(conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); &
conn.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);

I want to call an EJB method and irrespective of the success or not of the
method I want any messages placed on the JMS queue to stay there. ie
I do not want them removed in a rollback of the session bean transaction.
How can i do this?
Using false on the JMS session creation does not seem to disable transactions
and true does not seem to create a new transaction. In both cases the JMS
transaction joins to the session bean global transaction. How do I stop this?

Any ideas? Starting to get very frustrated.
Thanks
Markku

2004-02-16, 8:33 am

> I want to call an EJB method and irrespective of the success or not of the
> method I want any messages placed on the JMS queue to stay there. ie
> I do not want them removed in a rollback of the session bean transaction.
> How can i do this?
> Using false on the JMS session creation does not seem to disable transactions
> and true does not seem to create a new transaction. In both cases the JMS
> transaction joins to the session bean global transaction. How do I stop this?
>
> Any ideas? Starting to get very frustrated.
> Thanks


Hi!
JMS transaction is nested with your session bean transaction.
You propably now have "container managed" transaction in your
session bean. Have to change it "bean managed" -> write the
transaction commands to code and leave the JMS call outside of it.
-Markku-

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com