William,

On 12/5/23 14:39, William Crowell wrote:
I should clarify the ask here…

I have some long running JDBC queries against Oracle, and I do not
want to tie up Tomcat’s web thread pool with them.  I would only have
between 1-10 threads in this pool.

Executors aren't directly-accessible by applications. If you want to
off-load processing to another thread, you'll have to maintain your own thread-pool.

If you are using plain-old servlet dispatching, then off-loading to another thread won't save you anything: your request-processing thread will have to wait on your database-processing thread to complete before returning a response. It sounds like what you really want is servet-async where you put the request to sleep while you do something time-consuming and let the request-processing thread go back into the pool.

If you really are running the thread in the background, say, across requests, then you can do this with a thread pool that you, say, store in the application scope. I've done this myself, and end up storing a "progress object" in the user's session so that any subsequent request can check on the status of the long-running process.

-chris

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

Reply via email to