• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet calling EJB

 
anil bisht
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic