tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <ralph.einfe...@uptime-isc.de>
Subject RE: How to keep same thread during a session
Date Thu, 21 Aug 2003 14:01:09 GMT
The threads are request based. 

Each Thread services one request at a time.

So store the id at the start of each request in a global 
ThreadLocal or a global Hashtable with the thread as key. 
Then you can access this id from any method called in the 
lifetime of the same request.

If you have several entry points in to your application you 
could put this in a servlet filter. (This is a good place to 
place such things anyway)

> -----Original Message-----
> From: Roland Nygren [mailto:roland_nygren@msn.com]
> Sent: Thursday, August 21, 2003 3:48 PM
> To: tomcat-user@jakarta.apache.org
> Subject: How to keep same thread during a session
> 
> I.e. must this CallId be used in all logging.
> I would like to not have to pass this CallId as a parameter 
> in every method.

> int CallId = session.getParameter("CallId");
> fareFinder.search(from, to, departureDate, returnDate, 
> numberOfPassengers,  callId);
> 

Mime
View raw message