Hi there,
As long as you are careful and handle your threads properly, I've had no 
problems using Threads inside my web apps. I understand EJB containers 
are more strict on people not spawning threads but web containers don't 
usually have that many problems.

In any case, sometimes what I do is use a library like Quartz that I can 
use to schedule tasks to be run at a precise time/period or launch them 
right-at-the-time, if I need so. So far, I'm quite happy with that.

Daniel Lopez Janariz ([EMAIL PROTECTED])
Web Services
Centre for Information and Technology
Balearic Islands University

Pauly Shore escribió:

> I'm trying to work out a good clean way of creating a Timer thread inside a
> Resin 2.1.17 web container.
> Does anyone know a good way of implementing this?
> I have a requirement to perform some work-intensive background processing
> inside my web app, but it's too intensive to be done during a normal
> request/response cycle in my web application, so I'm looking for a way to
> 'spawn off' the processing - either into a Timer thread running in the
> background, or in a separate background thread that will not delay the
> response from the HTTP request coming in.
> I could just spawn off a thread inside my request handler, but I fear this
> is bad practice inside a web container, where the threads are managed by the
> container itself.
> Resin 3.0 has some lovely features like JCA and the Work Management API for
> managing long-working threads which would solve my problem but unfortunately
> I just can't upgrade at this point.
> Any help would be greatly appreciated. Thanks.
> Pauly
> PS. I'm using Resin 2.1.17 with Java 1.4.2_10 on Win XP (and also on Red Hat
> Linux).
> My web app is mostly Struts/JSP with Oracle JDBC Thin drivers.

resin-interest mailing list

Reply via email to