Bugs item #610907, was opened at 2002-09-17 20:28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=610907&group_id=22866
Category: JBossMQ Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Elias Ross (genman) Assigned to: Nobody/Anonymous (nobody) Summary: Using JMS in MDB/container-managed TX Initial Comment: I've gotten MDB to work correctly with rolling-back the database when I call mdc.setRollbackOnly(). However, I don't know how to create a QueueSession/Sender which will send its messages after the onMessage() method exists. I have bought the JBoss documentation, but it does not have an example of this case specifically. I suspect (but do not know) that JBoss does not support automatic QueueSession commit after an MDB exits its onMessage method. Looking at the source after a few hours has gotten me confused. I suspect this is NOT supported, if it is supported, please forgive this bug submission and point me in the right direction. This _should_ be documented, at least document how this is correctly done. The JMS tutorial: http://java.sun.com/products/jms/tutorial/ has several examples of Container-managed TX for MDB, which don't seem to work in JBoss. Does anyone have an example of this sending out messages: public class MessageDrivenBean implements MessageListener { // Container-managed transactions with Required // transaction attribute public void onMessage(...) { try { QueueConnection qc = qcf.createQueueConnection(); QueueSession qs = qc.createQueueSession(true, 0); QueueSender qsend = qs.createQueueSender("queue/A"); TextMessage m = qs.createTextMessage(); m.setText("test"); qsend.send(m); /* qs.close(); // JMS javadoc says this rollbacks // In any case, doesn't seem to work */ qc.close(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------- >Comment By: Elias Ross (genman) Date: 2002-09-18 13:02 Message: Logged In: YES user_id=556458 Thanks for responding corby. I guess the question in my mind, is a fix forthcoming? (In the next month or so.) It should be easy to associate a javax.jms.Session with a transaction, upon its creation, and have it automatically commit when onMessage() completes. If I could wrap my head around the code, I could probably come up with a quick fix in a few days. (My theory anyway.) If you could tell me what's going on with JBoss, I can either patiently wait for a fix, or go ahead now and re-write parts of my application. Again, I appreciate knowing MDB's have this limitation. ---------------------------------------------------------------------- Comment By: Corby (corby) Date: 2002-09-18 07:07 Message: Logged In: YES user_id=25032 Your bug submission is correct, Elias. This has been a long- standing and frustrating issue with JBoss. MDB's with container-managed transactions do not seem to have the same transactional semantics as other EJB's, and you MUST use bean-managed transactions if you want to enlist mutiple resources in an MDB transaction. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=610907&group_id=22866 ------------------------------------------------------- This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664 http://www.developwithamd.com/developerlab _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
