Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 71362 invoked from network); 25 Apr 2005 18:40:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2005 18:40:30 -0000 Received: (qmail 98215 invoked by uid 500); 25 Apr 2005 18:41:01 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 98186 invoked by uid 500); 25 Apr 2005 18:41:01 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 98172 invoked by uid 99); 25 Apr 2005 18:41:01 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from manta.curalia.se (HELO manta.curalia.se) (213.115.149.212) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 25 Apr 2005 11:41:01 -0700 Received: from [192.168.1.5] (unknown [80.64.176.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by manta.curalia.se (Postfix) with ESMTP id 2CC7BABC061 for ; Mon, 25 Apr 2005 20:40:26 +0200 (CEST) Message-ID: <426D399C.2000706@apache.org> Date: Mon, 25 Apr 2005 20:40:28 +0200 From: =?ISO-8859-1?Q?Martin_Kal=E9n?= Organization: ASF User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: OJB Developers List Subject: Re: PreparedStatement caching References: <426A821B.3040005@apache.org> In-Reply-To: <426A821B.3040005@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Armin Waibel wrote: > Now it's totally different. The PB, ODMG API are only 35% slower than > plain JDBC. The statement cache boost performance. > > Is it reasonable to include a new configurable feature > "statementCaching=on/off" in 1.0.x and 1.x or should always the > jdbc-driver or connection-pool do such things? Anything that can boost OJB performance and that is switched off by default should only be a benefit, as far as I can tell. But please leave this disable by default since memory requirements usually rise quite rapidly if caching stuff that might hold on to ResultSet data etc and since it might introduce extra overhead for the drivers that already do caching of PreparedStatement automatically. When you create your implementation, also consider dropping everything from you cache that does not have any positional parameter at all since caching eg: SELECT column FROM TABLE WHERE conditional_column = 1; SELECT column FROM TABLE WHERE conditional_column = 2; SELECT column FROM TABLE WHERE conditional_column = 3; ...etc will fill up the cache quickly and stop it from making greater benefit for proper reusable statements like: SELECT column FROM TABLE WHERE conditional_column = ?; (Since I assume you have some LRU/round robin or similar algorithm with a fixed max size.) Also, when you are working in this area: could you have a look at this class: org.apache.ojb.broker.accesslayer.SQLCachingStatementsForClass To me it looks really similar to StatementsForClassImpl, but never (?) had a commented entry in OJB.properties for StatementsForClassClass setting and is per Vadim's last patch outdated (not supporting ResultSet as out-param from callable statements). Could we just remove this class? Regards, Martin --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org