On Tue, 10 Jul 2001 [EMAIL PROTECTED] wrote:
> Hello,
>
> I have a slight problem involving message driven beans here :
>
>
> "ReaderMDB" listens on topic "Magazine" for messages containing "Reader" in the
>message-property "Receiver-Classes".
> It is a messagedriven bean able to handle state information in a database.
>
> onMessage() does the following :
> - reads message-property "Reader-ID" to know which customer the ReaderMDB
>represents.
> - reads from table "readers-desk" : if the appropriate record is showing "instance
>activated", then it must die and the message must remain in the topic for consumption
>! (the purpose is not to have 2 ReaderMDBs representing the same "Reader" updating
>their state at the same time !!)
>
> - updates table "readers-desk" with "instance activated"
> - does some message postings to the topic.
> - does some other database reads and updates
> - updates appropriate record in table "readers-desk" with "no instance activated".
>
> Well, from what I understood from the specification of MDBs and JMS, it is possible
>to do all this atomically.
>
> Imagine an exception is thrown in the onMessage method :
> 1) updates to databases will BE rolled back if an exception occurs within this - is
>this true for JBoss/JBossMQ ?
> 2) consumption of the message will be "rolled back", so that another instance may
>consume this message later from the topic "Magazine".
> 3) message postings done within onMessage will also be rolled back.
>
> Am I right here ? The problem is : we cant afford commercial products to support
>this. I hoped this was supported by JBoss and JBossMQ.
If you use a version of 2.4 or more this is supported if you use the jms
ra adapter. (described several times on this list and dev)
In 2.2.x messages sent will not be transacted by the container.
>
> 4) what happens if the MDB issues a message to the topic it had consumed from ? will
>this be rolled back ? will this be possible at all ?
> 5) what happens if the MDB issues a message to the topic it had consumed from, and
>this message may be a message to itself. Does this open up any conflicts ?
>
To my knowledge this should work fine.
//Peter
> Best regards, Jubin
>
>
Jobba hos oss: http://www.tim.se/weblab
------------------------------------------------------------
Peter Antman Technology in Media, Box 34105 100 26 Stockholm
Systems Architect WWW: http://www.tim.se
Email: [EMAIL PROTECTED] WWW: http://www.backsource.org
Phone: +46-(0)8-506 381 11 Mobile: 070-675 3942
------------------------------------------------------------
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user