Two Laptop Bag*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and Client Side Timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and Client Side Timeout" Watch "EJB and Client Side Timeout" New topic
Author

EJB and Client Side Timeout

Maulin Rathod
Greenhorn

Joined: Dec 17, 2008
Posts: 11

Hi
I have a java servlet which accesses a stateless EJB on JBoss on a remote server, using code
like
Object objref = initial.lookup("TestBean");
CalculatorRemoteHome home = (TestRemoteHome) PortableRemoteObject.narrow(objref,TestRemoteHome.class);
TestRemote echo = home.create();
int retval=echo.do_long_request();

I want to set a timeout on the method "do_long_request"
ie
1) Request data from ejb
2) if ejb requires more the say 30 seconds to process request and send back result data to client then
timeout on the client side and show a kind of "request took too long" error page.

Is is possible to set such a timeout , either by a config file setting or programatically?
Thanks in advance
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9912
    
158

Its possible. Which version of JBossAS and EJB do you use? Look at %JBOSS_HOME%/server/< serverName>/conf/jboss-service.xml for the default timeout (=300 seconds) on the transaction manager.

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB and Client Side Timeout
 
Similar Threads
Webservice timeouts
EJB calling another EJB over a Network
how to set timeout in a web service client with JAX-WS 2.0?
session timeout
Interview question asked to me which I could not answer