Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 82167 invoked from network); 26 Apr 2005 23:22:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2005 23:22:52 -0000 Received: (qmail 21555 invoked by uid 500); 26 Apr 2005 23:23:11 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 21532 invoked by uid 500); 26 Apr 2005 23:23:11 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 21509 invoked by uid 99); 26 Apr 2005 23:23:10 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of nybbas@gmail.com designates 64.233.162.197 as permitted sender) Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.197) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 26 Apr 2005 16:23:10 -0700 Received: by zproxy.gmail.com with SMTP id 34so155682nzf for ; Tue, 26 Apr 2005 16:22:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KhXvYAAjKNqy03sWtaucJhfbn5YOJu0qFnIQS+1sAJE7yyZt8/EV5dBYb+uKhhebDQDID25i0UtQrkHm1S9zP6SKx/C+UXtko31Kwi43G7Allt1nEu4ecmSvddfwmZb0Lbp8UFKQjA/guNkrGUixh04Rd3aLEfrqbaaicbz56dw= Received: by 10.36.72.20 with SMTP id u20mr14729nza; Tue, 26 Apr 2005 16:22:19 -0700 (PDT) Received: by 10.36.61.20 with HTTP; Tue, 26 Apr 2005 16:22:19 -0700 (PDT) Message-ID: Date: Tue, 26 Apr 2005 18:22:19 -0500 From: Andre Van Klaveren Reply-To: Andre Van Klaveren To: Tomcat Users List , Riyad Kalla Subject: Re: Tomcat creating new sessions between Servlet->JSP request dispatch under load In-Reply-To: <98ca874a05042615207c3e6a46@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <98ca874a05042615207c3e6a46@mail.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Riyad, You should not be using the Session object to store your DTO for display. Especially if you are forwarding the request to a JSP. The Session object should only be used to store data that is required to remain in server memory between client requests. I would place your DTO in the Request object instead. That alone will probably solve your problem. Now, assuming you continue to use the Session object, you should synchronize on the Session object before attempting to add your DTO object to it. That will prevent multiple requests from stepping on each other while trying to add their DTOs to the Session. I haven't looked at Tomcat's code to see how they implemented the hashCode method of the Session object but it's not the best way to determine if two Sessions are equal in your case. The hash code may depend on the contents of the Session object. I would print out the session ID instead. This will truely tell you if you have two different sessions. From what you describe I find it hard to beleive that you there is a second session creeping into the picture within the same request. --=20 Virtually, Andre Van Klaveren SCP --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org