users@glassfish.java.net

Re: EJB3 Observer pattern

From: <glassfish_at_javadesktop.org>
Date: Tue, 19 Feb 2008 08:53:10 PST

<p><blockquote>message driven beans are operating in its own
context.They don't
continue publisher's transactions and they know
nothing about
publisher's context</blockquote>

Wow; I did not know this. Are you quite sure? Section 5.4.12 of the EJB 3.0 specification makes no mention of this, and section 13.2.2 says:

<blockquote><b>13.2.2 Messages Sent or Received Over JMS Sessions and Update of Multiple Databases</b>
<p>The Enterprise JavaBeans architecture makes it possible for an application program to send messages to
or receive messages from one or more JMS Destinations and/or to update data in one or more databases
in a single transaction.</p>
<p>In the following figure, a client invokes the enterprise bean X. Bean X sends a message to a JMS queue
A and updates data in a database B using connections that the Deployer configured to connect with a
JMS provider and a database. Then X calls another enterprise bean, Y. Bean Y updates data in database
C. The EJB server ensures that the operations on A, B, and C are either all committed, or all rolled
back.</p></blockquote></p>

<p>(Now obviously this doesn't say what A is doing, which is the whole point of what we're talking about.)</p>

<p>Having said that I am in no position to doubt you as the interaction between MDBs and EJBs is a hole in my knowledge here.</p>

<p>Best,<br/>
Laird</p>
[Message sent by forum member 'ljnelson' (ljnelson)]

http://forums.java.net/jive/thread.jspa?messageID=259695