Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 73658 invoked from network); 11 May 2005 15:39:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 May 2005 15:39:42 -0000 Received: (qmail 92068 invoked by uid 500); 11 May 2005 15:42:48 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 91989 invoked by uid 500); 11 May 2005 15:42:47 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 91947 invoked by uid 99); 11 May 2005 15:42:46 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ap-cocoon-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 11 May 2005 08:42:46 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DVtAX-0003GO-LK for dev@cocoon.apache.org; Wed, 11 May 2005 17:30:41 +0200 Received: from srvgw12.rauser-ag.com ([217.146.133.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 May 2005 17:30:41 +0200 Received: from joerg.heinicke by srvgw12.rauser-ag.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 May 2005 17:30:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@cocoon.apache.org From: Joerg Heinicke Subject: Re: Re: [IMP] synchronization on session object in Cocoon Date: Wed, 11 May 2005 15:29:55 +0000 (UTC) Lines: 36 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 217.146.133.165 (Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.7) Gecko/20050414 Firefox/1.0.3) Sender: news X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Nathaniel Alfred swx.com> writes: > AFAIKS is the purpose of the existing synchronized(session) bits to > protect the consistency of the session object in case it is shared > between parallel executing requests. Yes. > IIUC you need a lock object to really synchronize parallel requests. > There I'd say the session is the wrong candidate due to the mentioned > possible dependency on the servlet That's where you and I have different interpretations. The sentence you quoted is IMO only about information hiding between different web applications. It does not say anything about if it is guaranteed to have exactly one session object or not. Another sentence is the following [1]: "The servlet container uses *this interface* to create *a session* between an HTTP client and an HTTP server. The *session persists* for a specified time period, *across more than one connection or page request from the user*." IMO this means _session_ is not only an abstract real world object, but a Java object. And you can access the same session object on different requests of the same (here "real world") session. > I am just afraid that keeping the wrapped sessions in a private map > may introduce a memory leak. But maybe WeakHashMap would take care > of this... Yes, see Sylvain's proposal or my other mail. Joerg [1] http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/ HttpSession.html