Re: Restarting a hung process
Chuck Hill <[email protected]> Fri, 25 Feb 2005 14:56:31 -0800
| Newsgroups | gmane.comp.web.webobjects.admin |
|---|---|
| Message-ID | <[email protected]> |
If you look on the Config page there is a Force Quit section at the
very bottom.
I usually add a ping direct action that looks like this:
public WOActionResults pingAction()
{
WOResponse pingResponse = new WOResponse();
pingResponse.appendContentString("<html><body>" +
WOApplication.application().name() + " is responding.");
// Check for database access
EOEditingContext ec = new EOEditingContext();
ec.lock();
try
{
// fetch an object here
}
catch (Throwable t)
{
pingResponse.appendContentString("<br><br><b>Database
access failed:</b><br>");
pingResponse.appendContentString(t.getMessage());
}
finally
{
ec.unlock();
ec.dispose();
}
pingResponse.appendContentString("</body></html>");
pingResponse.setHeader("text/html", "content-type");
return pingResponse;
}
you can curl that to verify that the app is responding.
HTH
Chuck
On Feb 25, 2005, at 2:47 PM, John Pollard wrote:
> I guess the lifebeat thread of a hung app instance keeps on happily
> running so there is no way for JavaMonitor to kill a hung app is
> there? Does anyone have a script to check if their app instances are
> actually responding to requests and to kill them if not?
> Thanks
> John
>
> _______________________________________________
> WebObjects-admin mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-admin
>
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects