servlet calling EJB

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

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

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

posted 15 years ago

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"

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

posted 15 years ago

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