On 27/11/2023 01:49, Adwait Kumar Singh wrote:
Hmm, this gives me an impression that the Servlet APIs expect the
request/response processing to *always *happen on the container thread.
If I attempt to perform it on a non-container thread after making the
request async, I run into the risk of the Request/Response objects being
recycled without my non-container thread being aware of it or having to
block my container thread.
The concurrency requirements for asynchronous processing are set out in
section 2.3.3.4 of the Servlet specification.
Implementing Error handling is significantly more complicated with
asynchronous servlets but it boils down to avoid accessing the request,
response and associated objects after complete()/dispatch() have been
called.
Mark
On Sat, Nov 25, 2023 at 5:42 AM Mark Thomas <ma...@apache.org> wrote:
On 25/11/2023 05:30, Adwait Kumar Singh wrote:
Is there a way around this, to keep the async context open even on an
error
and not close it till complete is invoked?
No. The spec requires the error handler to call complete() in onError()
and error handler doesn't, the container must.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org