>>>>> "Alvin" == Alvin Wang <[EMAIL PROTECTED]> writes:
Alvin> The other limitation is MDB is stateless.
Alvin> -----Original Message-----
Alvin> From: A mailing list for Enterprise JavaBeans development
Alvin> [mailto:[EMAIL PROTECTED]]On Behalf Of Johan Eltes
Alvin> Sent: Monday, March 18, 2002 12:57 PM
Alvin> To: [EMAIL PROTECTED]
Alvin> Subject: Re: Is MDB the best choice for asynchronous request handling in
Alvin> EJB?
Alvin> What kind of limitations are you experiencing?
Alvin> /Johan
You've noticed that you can't "cancel" a message, and also that MDB is
stateless (which are essentially related).
You might consider a strategy for reducing the impact of those two facts, as
opposed to finding a complete alternative.
For instance, instead of making the MDB stateful, associate non-transient state
with an ID in the message. So when the message is first sent, a lightweight
database record indicates the "state" of the message, like whether it's
canceled or not. When the message is finally taken off the queue, get the
lightweight database info associated with the message. If it says it's
canceled (as the result of a separate operation), then drop the message and the
lightweight record.
Another possibility for storing "state" for messages is having multiple
queues. The queue the message is in indicates what "state" it is in. This
might be combined with the lightweight database record, so you know what queue
to transition a message to.
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]
===========================================================================
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".