Author: boisvert Date: Thu May 17 13:33:13 2007 New Revision: 539106 URL: http://svn.apache.org/viewvc?view=rev&rev=539106 Log: TransformerFactory is not thread-safe, so we must synchronize
Modified: incubator/ode/trunk/utils/src/main/java/org/apache/ode/utils/DOMUtils.java Modified: incubator/ode/trunk/utils/src/main/java/org/apache/ode/utils/DOMUtils.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/utils/src/main/java/org/apache/ode/utils/DOMUtils.java?view=diff&rev=539106&r1=539105&r2=539106 ============================================================================== --- incubator/ode/trunk/utils/src/main/java/org/apache/ode/utils/DOMUtils.java (original) +++ incubator/ode/trunk/utils/src/main/java/org/apache/ode/utils/DOMUtils.java Thu May 17 13:33:13 2007 @@ -945,14 +945,16 @@ private static Transformer getTransformer() { Transformer txer = __txers.get(); if (txer == null) { + synchronized(_transformerFactory) { try { txer = _transformerFactory.newTransformer(); - __txers.set(txer); } catch (TransformerConfigurationException e) { String errmsg = "Transformer configuration error!"; __log.fatal(errmsg, e); throw new Error(errmsg, e); } + } + __txers.set(txer); } return txer; }