David,
There's no problem creating threads inside a servlet container.
Dave
On Mon, 2003-12-29 at 20:09, David Wall wrote:
> I recall reading that conformant servlets and such (EJBs?) do not create
> their own threads, something about being a container issue.
>
> Does anybody know the primary objection to launching threads that take on a
> life of their own? The container doesn't really need to manage it, per se.
> I suppose a container can drop servlet objects from memory, but as that
> wouldn't necessarily affect a daemon thread, it seems that doesn't harm
> launching them at startup.
>
> Does anybody know if most servlet containers today (Tomcat 4+, WebLogic,
> WebSphere...) have a real problem with such new threads being created or
> not? What would be the risk in my using them?
>
> For example, while I understand the need for a request to drive servlets,
> even WEB-INF/web.xml allows me to configure servlets that are invoked when
> the system is started, for example, and the need for background processing
> tasks is quite common in even mildly sophisticated applications (like
> threads that check for changed or new files locally or via URLs, or do
> backups, or find old data that can be automatically deleted, or for sending
> alerts to people after so much time has passed, unlocking a blocked activity
> after so much time has passed, etc.). It's quite easy to create new threads
> that wake up periodically and perform a myriad of application chores that
> are outside of the scope of an external event driving a transaction.
>
> My application could be streamlined quite a bit if I could get rid of a
> standalone Java application that does those server-based tasks on behalf of
> the servlet application.
>
> Thanks,
> David
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Dave Cramer
519 939 0336
ICQ # 1467551