TimeOut for EJB method calls


EJB programming & troubleshooting: TimeOut for EJB method calls

  1. TimeOut for EJB method calls (7 messages)

    Hi All,
       Is there a way I can force an EJB method to stop processing/timeout and return control (maybe an exception)?.

    Our specific requirement is that we have an EJB application that may take a long time to process and we do not want the client EJB to wait that long. Hence, I was looking for a mechanism to return control if the method processing does not finish by the timeout period.


    Threaded Messages (7)

  2. I suggest usage of the transaction timeout.
  3. Yes, We tried the transaction timeout but it did not do the job.

    The transaction timeout only times out the transaction and rolls back the transaction in the context but does not interrupt the method execution. So, we get a transaction timeout exception after the complete processing is over.
  4. In case of CMT you are right, try with BMT.
  5. TimeOut for EJB method calls[ Go to top ]

    Use Statement.setQueryTimeout()
  6. I am going through the same issue. I was wandering if your question was answered.
  7. Hi,

    we are also having a similar issue in our setup. we have an EJB in our application which is calling the methods of a remote EJB running on some other machines. Now at times the remote EJB donot responds in time and leaves the connection as such with the client (my EJB). When there is high load, such scenario lead our server into a hung siuation where we are left with piling open connections and every thing goes for toss.

    If anyone can provide any popinters on how can we timeout may be at client end or server end to stop the processing and return the control may be in the form of exceptions.

  8. TimeOut for EJB method calls[ Go to top ]

    Hi ,

    We also want to set up timeout for Remote EJB calls. Please let me know if anybody able to resolve it.