aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Timeout" Watch "EJB Timeout" New topic
Author

EJB Timeout

Guruprasad Kateel
Greenhorn

Joined: Jul 10, 2003
Posts: 16
I am calling a method on a Stateless Session Bean which is not in a transaction. Is there a way to timeout this method call if the client doesnot receive the response in the specified time interval?
I am using Weblogic 6.1 sp4.
Thanks in advance.
Prasad
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

I don understand why do you need this feature. If the server is not available it is going to throw execption anyway.


Groovy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Maybe the operation has shorter timeout than the RMI call normally would have? If you can't figure out any other solution, you could just launch a thread for calling the session bean and block in the original thread until the call-thread signals a response or the original thread decides enough time has passed and returns/throws an error to its own caller. It's dirty but it usually works.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
This was a duplicate. Sorry. (Can't delete this post right now...)
[ August 07, 2003: Message edited by: Lasse Koskela ]
Vinod John
Ranch Hand

Joined: Jun 23, 2003
Posts: 162
Originally posted by Guruprasad Kateel:
I am calling a method on a Stateless Session Bean which is not in a transaction. Is there a way to timeout this method call if the client doesnot receive the response in the specified time interval?
I am using Weblogic 6.1 sp4.
Thanks in advance.
Prasad

You may have to take a look at Timer service in EJB 2.1 (but WLS 6.1 is based on 2.0 ???). This article could be a good starting point
http://www.theserverside.com/resources/articles/MonsonHaefel-Column4/article.html
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Vinod,
The timer service is entriely different from timeout requirement of Gurruprasad.
Vinod John
Ranch Hand

Joined: Jun 23, 2003
Posts: 162
Originally posted by Pradeep Bhat:
Vinod,
The timer service is entriely different from timeout requirement of Gurruprasad.

Yes, I am wrong .. I was mislead by the "Timer" ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Timeout