I'm using Sun App Server 9 on one of my projects, and heard it was bad practice to spawn my own threads in my apps.
I want to start a thread that's constantly running in the background that does some work on a database, and sleeps and checks back a few seconds later if there's no more work to be done. And let's say I want 5 (or X) of these threads running at a time.
In App Server 9, I see in the admin console a quot;thread-pool-1quot; in the default installation (which has a maximum thread count of 200. Is it best practice to use the thread pool in the app server? If so, how can I retrieve and use the threads in this managed thread pool with Spring? |