Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2B0B163326E for ; Sat, 1 May 2010 13:59:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 41605-03 for ; Sat, 1 May 2010 16:59:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2.infomaniak.ch (smtp2.infomaniak.ch [84.16.68.90]) by mail.postgresql.org (Postfix) with ESMTP id EB9B66331EA for ; Sat, 1 May 2010 13:59:17 -0300 (ADT) Received: from pasiphae.local (lab75-1-81-57-32-171.fbx.proxad.net [81.57.32.171]) (authenticated bits=0) by smtp2.infomaniak.ch (8.14.2/8.14.2) with ESMTP id o41GxEYQ030900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 1 May 2010 18:59:15 +0200 Message-ID: <4BDC5DE2.7070402@zenika.com> Date: Sat, 01 May 2010 18:59:14 +0200 From: Pierre Queinnec User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Concurrency issue in EscapedFunctions Content-Type: multipart/mixed; boundary="------------090609070507060705030904" X-Antivirus: Dr.Web (R) for Mail Servers on smtp2 host X-Antivirus-Code: 100000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/13 X-Sequence-Number: 20497 This is a multi-part message in MIME format. --------------090609070507060705030904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit [sending again as it never got delivered to the ML] Hi, It seems that there's a concurrency initialization issue in o.p.jdbc2.EscapedFunctions. I've attached a tentative fix for this. BTW, thanks a lot Kris for the commits on my previous patches! Cheers, -- Pierre Queinnec CTO - Zenika http://www.zenika.com --------------090609070507060705030904 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="EscapedFunctions.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="EscapedFunctions.diff" Index: org/postgresql/jdbc2/EscapedFunctions.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/EscapedFunctions.java,v retrieving revision 1.12 diff -c -r1.12 EscapedFunctions.java *** org/postgresql/jdbc2/EscapedFunctions.java 16 Nov 2008 12:14:06 -0000 1.12 --- org/postgresql/jdbc2/EscapedFunctions.java 1 May 2010 15:40:10 -0000 *************** *** 116,138 **** /** storage for functions implementations */ ! private static Map functionMap = null; ! /** * get Method object implementing the given function * @param functionName name of the searched function * @return a Method object or null if not found */ public static Method getFunction(String functionName){ - if (functionMap==null){ - Method[] arrayMeths = EscapedFunctions.class.getDeclaredMethods(); - functionMap = new HashMap(arrayMeths.length*2); - for (int i=0;i