Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 79563 invoked from network); 8 Jan 2008 11:52:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2008 11:52:11 -0000 Received: (qmail 63576 invoked by uid 500); 8 Jan 2008 11:51:59 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 63554 invoked by uid 500); 8 Jan 2008 11:51:59 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 63545 invoked by uid 99); 8 Jan 2008 11:51:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 03:51:59 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of the.mindstorm.mailinglist@gmail.com designates 209.85.146.179 as permitted sender) Received: from [209.85.146.179] (HELO wa-out-1112.google.com) (209.85.146.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 11:51:33 +0000 Received: by wa-out-1112.google.com with SMTP id m34so14690496wag.9 for ; Tue, 08 Jan 2008 03:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=cAFc7fFLa/ey0IvOwbPAI5hUPeowS/vnF+IUbvHRAp8=; b=eiG+rBeHZiP/as9aruzQ0S8aaS78kra3NsrtqNq5G5jVMzPHzjXu3Mapxgf4WcR/SZzbi/18RBcZz3g+dXwdXCTAhG9XevT2VVRBMvLm6efRpth8f+bjseswMVf74/CJ2Wcjkpi/hB6q7pvHYqzxzyCBG5e+JsL2phsqZ5jiKLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cv+9VN/S/KHbZ4qDdp68ix4gkImcDijRMVJpV/VoMm8CaBVBpkRTih5z2l7/tBA6rkRTqiYgpcaf7LcUUhaz/NotBhR11QoHHmTMjC7vTTv6WkTmduHcgfXsPC6+hYulI2pRTLEUkWyz7NxjqOQG6BI0Q7uOMUeRoCmtdBtCcsE= Received: by 10.115.108.1 with SMTP id k1mr736820wam.42.1199793098531; Tue, 08 Jan 2008 03:51:38 -0800 (PST) Received: by 10.115.60.10 with HTTP; Tue, 8 Jan 2008 03:51:38 -0800 (PST) Message-ID: Date: Tue, 8 Jan 2008 13:51:38 +0200 From: "=?UTF-8?Q?Alexandru_Popescu_=E2=98=80?=" To: users@jackrabbit.apache.org Subject: Re: Shared session pool In-Reply-To: <14685207.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <14486499.post@talk.nabble.com> <009501c84fb0$ee2af450$ca80dcf0$@co.uk> <14685207.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On Jan 8, 2008 11:37 AM, Andrea K. wrote: > > Hi Shaun, > I implemented an easy pool that hold a group of read-only session (15 per > workspace) and share them to users. A session is not dedicated to a request, > but is shared for multiple request. > > These are actual property in JCA connector xml: > > > > > > > > To ensure a polish situation in time, i run a scheduled task that clean the > pool every 30 min, and recreate 15 new sessions every time. Old sessions are > logged out or expires automatically. These ensure a correct value of > CacheManager, normally below 100. > > What do you think about that? > > It works well, is synchronized obviously, but performance seems to be better > than dedicated sessions. > > Just an issue. Sometimes the pool hang up and I think is linked to dead > sessions... Now I'm trying controlling also isLive session properties before > returning to user. > > Do you have any help to improve my code? > > I can share it if is needed... > > Thanks a lot. > > Andrea can you explain why have you decided to have the sessions shared between the requests and not one session per request? In case these JCR sessions are used for write operations then you'll need to synchronize on them and this may become very easily a real bottleneck of the app. A share nothing approach (a JCR session per request) combined with a session pool should give you all you need, and will definitely not lead to bottlenecks. The worst case scenario is when a request should be waiting for a session to be freed. cheers, ./alex -- .w( the_mindstorm )p. > > > sbarriba wrote: > > > > Hi Andrea, > > We use an "Open Session In View" pattern with Jackrabbit and > > org.apache.commons.pool.KeyedObjectPool. > > Within a Filter: > > * we determine the context workspace name from the request (based on the > > URL) > > * retrieve a JCR session from the pool > > * bind it to the thread for the duration of the request and > > * then return it to the pool again after the request completes. > > This has worked well for us. Hope this helps. > > Regards, > > Shaun > > > > -----Original Message----- > > From: Andrea K. [mailto:akregar@alteanet.it] > > Sent: 24 December 2007 10:47 > > To: users@jackrabbit.apache.org > > Subject: Shared session pool > > > > > > Hi all, > > I want to start a thread concerning forum users experience with session > > pool > > in (web) apps using JR. > > I read about many users are using pools in their applications. > > > > Does anyone want to share his knowledge/code? > > > > Thank you all. > > > > Best regards and Merry Christmas. > > AK. > > -- > > View this message in context: > > http://www.nabble.com/Shared-session-pool-tp14486499p14486499.html > > Sent from the Jackrabbit - Users mailing list archive at Nabble.com. > > > > > > > > -- > View this message in context: http://www.nabble.com/Shared-session-pool-tp14486499p14685207.html > > Sent from the Jackrabbit - Users mailing list archive at Nabble.com. > >