Re: Multi-threaded servlet environment

Поиск
Список
Период
Сортировка
От John Sidney-Woollett
Тема Re: Multi-threaded servlet environment
Дата
Msg-id 1946.192.168.0.64.1072769780.squirrel@mercury.wardbrook.com
обсуждение исходный текст
Ответ на Re: Multi-threaded servlet environment  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Список pgsql-jdbc
I'm surprised by BEA's response to you.

We create our own threads to manage background tasks (mainly interacting
with the database).

These threads are started by a servlet which is initialized when the
servlet container starts using the <load-on-startup> in the servlet tag in
web.xml

We also place code in the (same) servlet's destroy() method to set flags
and interrupt our threads to get them to complete and then quit. This way
the servlet container is able to shutdown gracefully.

AFAIK, we've not had any problems with this approach, and it meant that we
didn't have to write a separate app to manage the background processes.
Also, you can use the (same) servlet to display processing information
from the threads - this can be very useful to see what's going on.

John Sidney-Woollett

Marcus Andree S. Magalhaes said:
>
> We were about to lose a support agreement with BAE/Weblogic people
> simply because we were creating threads on our own.  No reasons
> were given to us, but they (BES) simply don't *recommend* the
> arbitrary creation of threads.
>
> I suspect it's this way because people can easily create lots of
> leaks, excessive CPU usage or something like that and then blame
> the application server for its ridiculous performance.
>
>
>
>> David,
>>
>> There's no problem creating threads inside a servlet container.
>>
>> Dave
>>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Drop support for jdk 1.1, 1.2 ?
Следующее
От: Kris Jurka
Дата:
Сообщение: COPY support implemented