I have an application with two queues and two message driven beans:

  Client --->   q1  ---> mdbA  ---> q2  ---> mdbB

In the onMessage() method of mdbA the incoming message is inspected
and then passed on to mdbB via q2.

Bean mdbA uses container managed transactions and its onMessage() method
has its transaction attribute set to Required.

Bean mdbA sets up queue connection, queue session and queue sender for q2
in its ejbCreate() method.

According to the Sun JMS tutorial, which has a section on JMS use in EJBs,
the arguments to QueueConnection.createQueueSession() are ignored when
queues are used inside beans that use container managed transactions. 
I have experienced behaviour that seems to contradict this: If the bean
mdbA creates its queue session (for q2) like this:

  qsession = qconn.createQueueSession(true,0);

then the messages it sends to q2 never reaches mdbB unless mdbA explicitly
calls qsession.commit() even though it uses container managed transactions.

If QueueConnection.createQueueSession() is called with the transact-argument
set to false, mdbA is able to send its message to mdbB without having to call
QueueSession.commit().

I had hoped that the container of mdbA would automatically call QueueSession.commit()
regardless of how the session was constructed,  since mdbA uses container managed 
transactions and its onMessage() method has the transactional attribute set to 
Required.

Are my expectations reasonable?

I am using JBOSS 2.2.1.

Lars

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to