[jboss-user] [JBoss Messaging] - Does QueueSession require transaction?

Bernard Labno do-not-reply at jboss.com
Mon Apr 11 13:33:34 EDT 2011

Bernard Labno [http://community.jboss.org/people/blabno] created the discussion

"Does QueueSession require transaction?"

To view the discussion, visit: http://community.jboss.org/message/599318#599318

Hi, I'm trying to make my pojo seam component to act as MessageListener. I've experienced something that is strange for me.
If i create transacted queue session (XASession) (without creating transaction, it's done in @Create method of component in application context at application startup), then start transaction and try to read message and then rollback the transaction then message does not get back to the queue.

However if i start transaction, create transacted queue session, pick message from queue and rollback transaction then message is put back in the queue.
The difference is that i start transaction before creating the session.

This limits me to using one session for each message if I want to have the atomicity. This way i have to use readNoWait instead of providing MessageListener implementing class.

Am I missing something? How is it done form MDBs? Is session created for every single message?

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110411/d007692b/attachment.html 

More information about the jboss-user mailing list