-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

On 4/28/2009 10:52 PM, David.Meldrum wrote:
> I need a background task which I implemented as a thread that I stated
> in the ContextListerner.

[snip]

> The problem I noticed is that while I only call
> the BackGroundThread.*start()* method once.  I see at least two threads
> running in Tomcat (las seen in Thread dump and looking at it in
> "Probe").

Are you re-deploying your application at all? If you are only starting
your thread, you will be starting a new thread for each deployment. So,
if you re-start your application, a second (or third, or fourth) will be
created.

Tomcat doesn't kill your application's threads when the app dies. You
need to end them yourself. Since you already have a ContextListener,
just add a destroy() method that shuts down the background thread.

Apologies if you're already doing this, but you didn't mention it and I
figure it's the most likely scenario.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn7JAIACgkQ9CaO5/Lv0PBQ/QCgq3ZlezGAiw8F9M9KiVG6lOjD
B8IAniSz5gk9WBZ97jS0pBjtxLp4IUlj
=hYDX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to