Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 86802 invoked from network); 2 Apr 2002 07:50:37 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Apr 2002 07:50:37 -0000 Received: (qmail 22543 invoked by uid 97); 2 Apr 2002 07:50:44 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 22526 invoked by uid 97); 2 Apr 2002 07:50:44 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 22513 invoked by uid 50); 2 Apr 2002 07:50:43 -0000 Date: 2 Apr 2002 07:50:43 -0000 Message-ID: <20020402075043.22512.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 7681] New: - Tomcat does not work properly in multithread environment X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7681 Tomcat does not work properly in multithread environment Summary: Tomcat does not work properly in multithread environment Product: Tomcat 4 Version: 4.0.4 Beta 2 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Major Priority: Other Component: Servlet & JSP API AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: marcin_ol@poczta.onet.pl This bug exists also in version 4.01, so it is much possible it exists in all 4.x versions. I found that Tomcat has a quite serious bug, that causes it not working correctly when more than one thread is processing requests. The bug appears when the welcome file is a FRAMESET definition file, which does not access session object nor use beans - the first access of session is by session-scope bean definition in pages, that are loaded in frames from this frameset. Now, since browser makes requests for frames concurrently, each frame is usually processed by different Tomcat thread. And there is a problem: if two frames uses the same bean (of session scope), it often gets initialized twice !!! (it usually happens when the bean communicates with database during init, or makes other time-consumpting operation). The workaround is to make welcome file access the session (e.g. by setting some attribute or by reading session ID) - then the bean gets instantiated only once. The reason for this bug is in servlet generated from JSP: there are parts that are synchronized on "session" object - it does not make any sense, since session is an instance of StandardSessionFacade, which is a page-level object - it is created as new object on every page, and every time the page is accessed (just print it on System.out - every time, different address is printed); it would make sense if the synchronization was on HttpSession object encapsulated by StandardSessionFacade. -- To unsubscribe, e-mail: For additional commands, e-mail: