Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22310 invoked from network); 18 Aug 2004 09:16:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Aug 2004 09:16:55 -0000 Received: (qmail 81464 invoked by uid 500); 18 Aug 2004 09:16:52 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 81311 invoked by uid 500); 18 Aug 2004 09:16:51 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 81296 invoked by uid 99); 18 Aug 2004 09:16:51 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received: from [195.130.132.57] (HELO apate.telenet-ops.be) (195.130.132.57) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 18 Aug 2004 02:16:47 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by apate.telenet-ops.be (Postfix) with SMTP id 3F19624819D for ; Wed, 18 Aug 2004 11:16:46 +0200 (MEST) Received: from pandora.be (D5E05826.kabel.telenet.be [213.224.88.38]) by apate.telenet-ops.be (Postfix) with ESMTP id 1FF6D248067 for ; Wed, 18 Aug 2004 11:16:46 +0200 (MEST) Message-ID: <41231E76.4010809@pandora.be> Date: Wed, 18 Aug 2004 11:16:38 +0200 From: Dirk Verbeeck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [Pool] New class/modification References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Yes, please change it to be the same as GenericObjectPool. Thanks Dirk Bowler Simon wrote: > Well it's not exactly the same as minIdle. Where minIdle only looks at the pooled idle instances. This implementation looks at the total pool for a key (active and idle). > > For consistancies sake, should we change it to be the same as GenericObjectPool and keep a minimum level of idle instances? > > I have integrated the changes into GenericKeyedObjectPool, following feedback to these questions, i will post a patch. > > Cheers, > > Simon > > > -----Original Message----- > From: Dirk Verbeeck [mailto:dirk.verbeeck@pandora.be] > Sent: Tuesday, 17 August 2004 9:43 PM > To: Jakarta Commons Developers List > Subject: Re: [Pool] New class/modification > > > OK, so you basically implemented the GenericObjectPool.setMinIdle > feature but for a KeyedObjectPool. > > Very usefull addition, I would even merge it into > GenericKeyedObjectPool itself. Having the same behaviour in the two > generic implementations is a good thing. > > You can post your code here or make a bugzilla enhancement request and > attach it to the issue. If you post the whole new file make sure you > include the Apache 2 license and not your company license. > > Otherwise you can merge your new feature into GenericKeyedObjectPool > and post a patch. > > > Cheers > Dirk > > > Bowler Simon wrote: > >>Hi >> >>The purpose of the new class is to maintain a minimum number idle instances in a pool, but grow as required up to a maximum number of active instances. The reason for maintaining a minimum level of idle instances in a pool, is for efficiency. A call to borrowObject() when there are no pooled instances available, must create an instance of the object required. This causes delays when the object it is instanciating needs to reserve resources or connect to remote systems (for example, an SMTPConnection). >> >>The new class proposed, features the following: >> >>Same features as provided by GenericKeyedObjectPool (idle eviction, validation of pooled objects on borrow/on return/when idle). >> >>Maintain a minimum number of pooled objects (per key). This number is configurable. >> >>A seperate thread will be used to periodically create any required objects to maintain the minimum level. This time period is configurable. >> >>The pool must be aware of a key before it can start maintaining a minimum number of pooled objects for that key. This can be performed by performing a borrowObject(key). However, this results in a potential delay whilst the pooled object is being created. An extra method preparePool(key) is used to give the pool knowledge of the key, so that it can start maintaining a minimum number of pooled objects for that key. This should result in a much quicker call to borrowObject(key), as pooled instances will already be created and waiting in the pool. >> >>The above features are essentially one patch. It was originally intended to extend GenericKeyedObjectPool, and add the new features. However, the fields in GenericKeyedObjectPool are private. >> >> >>Dirk - In the case of our system we were pooling custom connections to remote servers. These were not SQLConnections, but SQLConnections would also work with this modification. >> >>Cheers, >> >>Simon > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org