File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes servlet calling EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet calling EJB " Watch "servlet calling EJB " New topic
Author

servlet calling EJB

anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
hi,
My servlet is calling an EJB which is in the other server. If that EJB call is taking time (lets say greater than 10 sec) then can i display the message to the user, and discontinue with the call to the EJB ???
Is using threads a solution.. how ??
TIA
Anil
Musthafa
Greenhorn

Joined: Mar 05, 2002
Posts: 7
Hi,
what u mean by other server.moreover how do u know that it will take 10 secs to get a reply from ur ejb.it hardly takes 2 secs to get a response from ur ejb.
can u please specify the problem.
musthafa
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
musthafa
Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
Thanks!
and welcome to the JavaRanch!
anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
fine i got the response from the ejb server. But then that ejb is making some Database calls and handleing some of the business logic. So if all this processing is taking time, how can i display the message to the user that "The EJB is taking time"
Peter W Smith
Greenhorn

Joined: Aug 28, 2002
Posts: 10
use a MDB (Message Driven bean) and have the servlet sending request to it, then retrieve the reply from another messge queue with a timeout setting. If the servlet times out, display the message back to the user
anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
Originally posted by Peter W Smith:
use a MDB (Message Driven bean) and have the servlet sending request to it, then retrieve the reply from another messge queue with a timeout setting. If the servlet times out, display the message back to the user

I cant use message driven bean as the EJB is written by some othere vendor. And for getting the home and remote interfaces also they have given us the clases, so we just create an object of that class and that class in turn does all the remote calls. So we know nothing about that EJB. For us its just like a normal class.
Regards
Anil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet calling EJB
 
Similar Threads
EJB calls to servlet
How to deploy and Use a Session Bean
how 2 call ejb file using servlet
ejb
Calling servlets