Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

clarify stax comments, change logging level

Yonik Seeley11ec236ebfe3
diff --git a/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java b/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
index b6be0c2e7d1..81456fadaa7 100644
--- a/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
+++ b/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
@@ -83,12 +83,18 @@ public class XmlUpdateRequestHandler extends RequestHandlerBase
inputFactory = BaseXMLInputFactory.newInstance();
try {
+ // The java 1.6 bundled stax parser (sjsxp) does not currently have a thread-safe
+ // XMLInputFactory, as that implementation tries to cache and reuse the
+ // XMLStreamReader. Setting the parser-specific "reuse-instance" property to false
+ // prevents this.
+ // All other known open-source stax parsers (and the bea ref impl)
+ // have thread-safe factories.
inputFactory.setProperty("reuse-instance", Boolean.FALSE);
}
catch( IllegalArgumentException ex ) {
- // The java 1.5 com.bea.xml does not support this property, but behaves properly in a
- // multi-threaded environment. Ignore the error for 1.5
- log.info( "Unable to set the 'reuse-instance' property for the input factory: "+inputFactory );
+ // Other implementations will likely throw this exception since "reuse-instance"
+ // isimplementation specific.
+ log.fine( "Unable to set the 'reuse-instance' property for the input factory: "+inputFactory );
}
}