From a1f4429dc7ae29b0fd22493db12372ec65baa4bf Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 19 Nov 2010 10:03:23 +0000 Subject: TUSCANY-3791 - synchronize access to DOM and cache result to reduce chance of hitting the synchronization. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1036786 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java') diff --git a/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java b/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java index e6fc1b4405..5070d0636c 100644 --- a/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java +++ b/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java @@ -45,7 +45,11 @@ public class Node2JAXB extends BaseTransformer implements PullTran try { JAXBContext jaxbContext = contextHelper.createJAXBContext(context, false); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - Object result = unmarshaller.unmarshal(source, JAXBContextHelper.getJavaType(context.getTargetDataType())); + Object result; + // TUSCANY-3971 + synchronized(source){ + result = unmarshaller.unmarshal(source, JAXBContextHelper.getJavaType(context.getTargetDataType())); + } return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result); } catch (Exception e) { throw new TransformationException(e); -- cgit v1.2.3