You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by BugRat Mail System <to...@cortexity.com> on 2000/09/13 15:33:34 UTC

edit bug #27 by person #0 (logged in as: Nick Bauman)

Environment description modified:
   OS changed from 'Linux
' to 'Linux'.
   OS Release changed from '2.2.14
' to '2.2.14'.
   Platform changed from 'x86
' to 'x86'.

Bug description modified:
   Synopsis changed from:
    > Race condition during servlet initialization

   To:
    > Race condition during servlet initialization
Reproduce description modified:
   Description changed from:
    > 
   To:
    > The situation where I encounter this bug has the following
characteristics:

- I have a servlet with an init() method that involves starting up a
  JDBC connection, which is relatively expensive and synchronized.
  Furthermore, the servlet implements

Work around description modified:
   Description changed from:
    > 
   To:
    > Suggested fix that works for me:

I think that in org.apache.tomcat.core.ServletWrapper.handleRequest(...)
the code portion

  if (!initialized) {
    ...
    initServlet();
    ...
  }

should be enclosed in "synchronized (this) {...}".