Concurrency issue in EscapedFunctions
Concurrency issue in EscapedFunctions
От:
Pierre Queinnec <pierre.queinnec@zenika.com>
Дата:
[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
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