Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id B7B1C644FC5 for ; Fri, 10 Feb 2012 01:40:11 -0400 (AST) Received: from mail.kyon.de ([217.92.227.189]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RvjDK-00066j-Qv for pgsql-jdbc@postgresql.org; Fri, 10 Feb 2012 05:40:10 +0000 Received: from holly.fritz.box (deusexmachina.kyon.de [217.92.227.189]) (AUTH: LOGIN tt, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by mail.kyon.de with esmtp; Fri, 10 Feb 2012 06:39:52 +0100 id 00064E87.000000004F34ADA8.00001ADF Message-ID: <4F34ADA6.4050008@kyon.de> Date: Fri, 10 Feb 2012 06:39:50 +0100 From: Till Toenges User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Steven Schlansker CC: Dave Cramer , pgsql-jdbc@postgresql.org Subject: Re: Patch to fix bug #6293 - regression in driver performance with regards to ResultSetMetaData-heavy workloads References: <5CBAD10C-C4DB-4AE3-ADB4-8197E0AA4146@likeness.com> <20279E38-EDB7-4D2B-8DD1-A1CF5F3E9F1D@likeness.com> In-Reply-To: <20279E38-EDB7-4D2B-8DD1-A1CF5F3E9F1D@likeness.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/27 X-Sequence-Number: 22680 On 2012-02-10 05:20, Steven Schlansker wrote: > I'm not sure how locking applies here. There is no locking code that > I see in any of the ResultSet classes, nor did I add any, and it's my > understanding that ResultSet instances themselves are not to be > shared amongst threads. So this is not relevant. > > Let me know if I've misunderstood, Steven I don't know about sharing the result set. But the code is thread safe as it is. At worst, it would issue a few unneccessary extra requests to the server. But since the write to metaData is atomic, and it never gets set to null anywhere, eventually every thread would have a valid instance, just not neccessarily the same. Unless it is absolutely required that every call getMetaData() returns the same instance, that will be good enough. Till -- Kyon, Till Toenges, tt@kyon.de, http://kyon.de Obergplatz 14, 47804 Krefeld, +49-2151-3620334