tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Len Popp" <len.p...@gmail.com>
Subject Re: Aborting servlet init() method
Date Mon, 04 Sep 2006 15:10:26 GMT
If I understand the situation correctly,
You could use a filter to deny all requests to the servlet (return
HTTP error 500) while the database is down. On initialization you
check the database and set a flag to tell the filter if the database
is down. When the database comes back up (assuming you have some way
to detect this), you reset the flag so the filter will allow requests
to be processed.
-- 
Len

On 9/3/06, Peter Bauer <peter.m.bauer@gmail.com> wrote:
> Hi all,
>
> i have the following problem here:
> If the used database is not available at startup of the servlet, the
> initialization should be aborted and the servlet should be in a
> stopped state to be able to start it again if the database is
> available again.
> Waiting for the database is not an option since some processes will be
> left running when tomcat is stopped without a working database.
> So my question is how a servlet can be stopped from within the
> servlet? Throw some kind of exception?
>
> thx,
> Peter
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message