tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake McBride <>
Subject Tomcat reuses threads and connection instances
Date Wed, 26 Jan 2011 21:05:51 GMT

I have a web service app that runs under tomcat.  I just noticed the
following unexpected behavior.

The first time a particular web service is called tomcat starts a thread to
run it on and creates an instance of the class that implements the web
service.  All fine.  However, if after the first call to the web service
completes another call to the same web service occurs, tomcat reuses the
same thread and the same instance.  Of course this gives me old values for
thread local storage and instance variables for that web service.  This is
highly unexpected.

Is there a way to configure tomcat to have it give me a new instance of the
web service class each time?

In terms of the repeated thread use and thread local storage I have, for the
time being, started manually resetting the thread local storage.  Is there a
conventional solution to this problem?


Blake McBride

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message