3 Replies Latest reply on Nov 3, 2005 8:15 AM by adrian.brock

    Use the forums not JIRA to ask for help

       


      Okay, I am really not doing anything special. It is a simple MDB using bean managed transaction management. The MessageDrivenContext and ConnectionFactory are being injected with @Resource annotations. The UserTransaction is obtained from the MessageDrivenContext. The JMS connection is created in @PostConstruct once per instance. The JMS session is created and closed within the transaction boundaries (ignore the original code I have posted). You may use container managed transaction management as well. It does not matter.

      I expect the JMS session to commit when I commit the transaction (or leave the onMessage method in case of CMTM). However it seems not to. Please have a look at the Jonas Docs here (yes, I know JBoss is not Jonas, I am just using this as reference material now): http://jonas.objectweb.org/current/doc/PG_JmsGuide.html where it says "Starting Transactions after JMS Connection or Session creation" This is basically what I am doing.

      Sending a message from a MDB in a transaction seem something not many people are doing. Try finding sample code on the web for this case: There is none. I guess this case might not have a unit test in the JBoss test suite. So I am not actually surprised it doesn't work. But it is an important case that *must* work if JBoss is a compliant container.

      Do I have to post full source code to get this issue accepted? Just tell me what you are missing.