Hello,

The EJB 2.0 spec proposed final draft tells us, concerning MDB (Message
Driven Beans):

========================================
14.4.6 Concurrency of message processing (p. 314)
========================================
A container allows many instances of a message-driven bean class to be
executing concurrently, thus
allowing for the concurrent processing of a stream of messages. No
guarantees are made as to the exact
order in which messages are delivered to the instances of the message-driven
bean class, although the
container should attempt to deliver messages in order when it does not
impair the concurrency of mes-sage
processing. Message-driven beans should therefore be prepared to handle
messages that are out of
sequence: for example, the message to cancel a reservation may be delivered
before the message to
make the reservation.
========================================

I understand that in many cases this allows to speed up the processing i.e.
in the cases where the messages have no life cycle relationship, this
permits parallel processing.

Nevertheless, in the cases where the sequence is of first importance, MDBs
are false friends! The JMS queue take good care of handling messages in the
correct sequence until delivery and then the EJB server may mess it up!
Optimization is good as long as basic semantic is still possible.

Don't you think that the spec should incorporate the use of a "flag" which
would indicate if the messages original sequence needs to be preserved or if
it may be changed in order to speed up the processing?

Furthermore, using whatever synchronisation mechanism in the MDB is not a
good solution because the EJB server may dedicate us many threads, all
waiting on a single thread (the one owning the critical resource). This flag
would in fact prevent the container from mis-using threads (dedicated to
waiting).

Am I lost somewhere with my suggestion?

Cheers,



                                Sacha

===========================================================================
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