ThreadLocal and NIO

2010-09-04 Thread Wesley Acheson
Hi,

Currently we use a filter and log4j's NDC to store details of the request
such as our identifier for the user and their Ip address. We then have a log
pattern which puts these details in the log. This way if we have any errors
we can easily associate them back to the origional request.  This works very
well. Currently we are using 6.0.18.

However, If I understand it correctly. If we change to use NIO for the
connectors it isn't thread per request any longer so setting something into
log4j's NDC which uses ThreadLocal may not associate the variable with the
actual request.  Is this correct? If it is is there any way I can
consistantly append the details of the session with the current activity
such as running a SQL query. I'm not keen on passing the session details
through every call on our system.

Regards,


Wesley Acheson


RE: ThreadLocal and NIO

2010-09-04 Thread Caldarale, Charles R
From: Wesley Acheson [mailto:wesley.ache...@gmail.com] 
 Subject: ThreadLocal and NIO

 If I understand it correctly. If we change to use NIO for the
 connectors it isn't thread per request any longer

No, the same thread still processes one request all the way through.  However, 
there is no longer one thread per TCP connection, as there is with the blocking 
connector.  So if a client is sending multiple requests on one TCP connect 
(HTTP pipelining), each request of the series may well be handled by a 
different thread.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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