JMS transactions and session beans

M

Mark

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
 
M

Markku

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-
 
V

Vinsan

Hi Mark -

I was looking for something similar, in the sense, wanted to next the
JMS transaction into bean transaction, but the message commit or
rollback is not happening as part of bean transaction. Can you let
know any specific bean settings or JMS settings to accomplish it.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

jms + eclipse 1
JMS + glassfish 0
JMS / JNDI Error 0
JMS messaging question 2
Session Beans 2
Questions - JMS Durable Topics and Subscriptions 2
performance problem with JMS 1
jms and tomcat 0

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top