I am currently working with JBoss 3.0.8. My application has a stateless session EJB that performs a DB update and sends a JMS message. I want the DB update and JMS message send to be managed in the same JTA transaction context. The EJB is using a container managed transaction.
The J2EE 1.3 spec isn't very clear about how this works with managed transactions, but according to the Sun tutorial at http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/j2eeapp2.html, the container should manage the JMS transaction if the session is creating using this call: session = connection.createQueueSession(true, 0); The call to session.commit() should be unnecessary since the container manages the transaction. However, when I try this from JBoss it appears the JMS transaction is never committed and therfore the message is never sent. If I instead use connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE) then I run into the problem where the JMS message is immediately commited independent of the session EJB transaction. Depending on timing the message receiver may attempt to process the message before the session EJB's transaction has committed, which is a problem since the receiver needs that data. Can anyone provide any hints on how to get JBoss to coordinate the JMS transaction as part of the session EJB transaction when sending a message from a session EJB? Thanks, David Johnson StorePerform Technologies, Inc. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3863006#3863006 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3863006 ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
