Bugs item #610907, was opened at 2002-09-18 03: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: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Elias Ross (genman)
>Assigned to: Adrian Brock (ejort)
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: Adrian Brock (ejort)
Date: 2003-03-15 00:18

Message:
Logged In: YES 
user_id=9459

This is supported using the connection manager bound at
java:/JmsXA

Regards,
Adrian

----------------------------------------------------------------------

Comment By: Elias Ross (genman)
Date: 2002-09-18 20: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 14: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:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to