0 Replies Latest reply on Apr 11, 2011 1:33 PM by Bernard Labno

    Does QueueSession require transaction?

    Bernard Labno Master

      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?