From: | "John Sidney-Woollett" <johnsw(at)wardbrook(dot)com> |
---|---|
To: | "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br> |
Cc: | pg(at)fastcrypt(dot)com, d(dot)wall(at)computer(dot)org, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Multi-threaded servlet environment |
Date: | 2003-12-30 07:36:20 |
Message-ID: | 1946.192.168.0.64.1072769780.squirrel@mercury.wardbrook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2003-12-30 08:25:00 | COPY support implemented |
Previous Message | Kris Jurka | 2003-12-30 07:20:03 | Re: Drop support for jdk 1.1, 1.2 ? |