EJB/JMS can be used to solve this problem; however, it should be noted that the
main benefit of integrating JMS with EJB is to enable notification driven
application integration, i.e. 'business events'.
This problem can be handled using JMS in the following way (see the JMS spec for
full details):
The schedule lookup uses JMS to create and send a request/reply style message to
a stateless session, message listener DB Query EJB (which the container would
activate on message receipt, and to which it would deliver the message using the
JMS MessageListener onMessage(Message) method). Meanwhile the schedule lookup
would continue on to load its data and then do a synchronous receive on the
message's ReplyTo destination (normally a destination that is unique for this
message, in JMS speak, a temporary destination). When the DB Query EJB has
finished the query it responds with the result in a reply message.
The integration of EJB and JMS is a powerful facility. Much of this integration
is specified since it relies primarily on using two specified technologies - JMS
and EJB. However, the application model for this integration still needs
additional work. Sun has publicly stated that JMS integration is an EJB 2.0
task. We will be working with the EJB and JMS communities to achieve the
complete specification of this integration. Even though full specs not currently
available, the early implementations of this integration are important steps
forward.
-- Mark
Bob Pasker wrote:
> have the bean submit a JMS request to a waiting thread, which
> processes the request in parallel and sends a response. the requesting
> bean then waits (with timeout!) on the JMS response. of course,
> you have to use a server that has JMS support, like WebLogic.
>
> --b
>
> At 06:12 AM 5/20/99 , Grove, Andy wrote:
> >When a client requests a set of schedules I call a fairly quick stored
> >procedure to get a list of schedules that have been modified in the
> >database, which returns zero rows most of the time but is still a bit slow.
> >Ideally I would like to have this procedure running at the same time that I
> >am loading objects from the disk based cache but the EJB spec prohibits me
> >from spawning threads from within session beans.
>
> ===========================================================================
> 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".
===========================================================================
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".