summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-19 10:03:23 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-19 10:03:23 +0000
commita1f4429dc7ae29b0fd22493db12372ec65baa4bf (patch)
tree68a106032ac0e273549551294be8fad9cc3e6ff6 /sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java
parent4e4495c18bb437c3e8a044ca40248e6024d3d0f9 (diff)
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
Diffstat (limited to 'sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java6
1 files changed, 5 insertions, 1 deletions
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<Node, Object> 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);