AtomGraph / Processor

Ontology-driven Linked Data processor and server for SPARQL backends. Apache License.
https://hub.docker.com/r/atomgraph/processor/
Apache License 2.0
58 stars 7 forks source link

ConcurrentModificationException in during OntModel acccess #16

Closed namedgraph closed 8 years ago

namedgraph commented 9 years ago

Under a higher load, concurrent access becomes an issue as OntClassMatcher.matchTemplates() throws an ConcurrentModificationException. Since Ontology instance is reused (it is cached in OntDocumentManager), the code accessing it should probably be synchronized.

namedgraph commented 8 years ago
java.util.ConcurrentModificationException: Due to closed iterator
    org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.checkClosed(LPTopGoalIterator.java:257)
    org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.moveForward(LPTopGoalIterator.java:93)
    org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.hasNext(LPTopGoalIterator.java:223)
    org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
    org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
    org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
    org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
    org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
    org.apache.jena.util.IteratorCollection.iteratorToList(IteratorCollection.java:63)
    org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:156)
    org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:151)
    org.apache.jena.rdf.model.impl.ModelCom.add(ModelCom.java:201)
    org.graphity.processor.provider.OntologyProvider.getOntModel(OntologyProvider.java:255)
namedgraph commented 8 years ago

Fixed by cloning OntModel in OntologyProvider