----- Original Message -----
From: Bhattacharyya, Ana <[EMAIL PROTECTED]>
> or rather when do u need asynchromous calls to a
> bean. can anyone describe the situation where I may need such things. Also
> which model is best suited for ejb -- the pub/sub model or the P2P model??

Think of a workflow where four things need to all happen before the fifth
one can.  It does not matter how things one through four happen, or when
they happen: it simply matters that they all occur, successfully or
erroneously.  Only then, let's say, can you do your fifth action.

Since you cannot use threads in a session bean, you cannot, for example,
inside a stateless session bean do actions one through four in parallel.
You just can't do it.  You must do item one followed by item two followed by
item three.  If each action could be done in parallel, and each action takes
four days, then you can see that NOT doing them in parallel--i.e. working
with EJB session beans--results in a terrible architecture.

This is a barn-sized hole in the EJB specification.  The way that you are
supposed to be able to get around this in the 2.0 specification will be via
pub/sub messaging over JMS, where each action to be performed is essentially
the publishing of a message to either another bean or a third-party program.

In my mind this only solves some of the problems and completely ignores the
simple multiplexing thread problem I presented earlier.

Cheers,
Laird

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to