Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

servlet calling EJB

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic