sszuev opened a new issue, #2195:
URL: https://github.com/apache/jena/issues/2195

   ### Version
   
   5.0.0-SNAPSHOT
   
   ### What happened?
   
   The following code works fine in version 4.10.0, but throws an exception in 
version 5.0.0-SNAPSHOT:
   ```java
   Model m = ModelFactory.createModelForGraph(new GraphTxn());
   Node x = m.createResource("X", OWL.Class).asNode();
   Graph g = m.getGraph();
   ExtendedIterator<Triple> it = g.find(Triple.create(x, Node.ANY, Node.ANY));
   it.toList();
   g.add(Triple.create(NodeFactory.createURI("42"), Node.ANY, Node.ANY));
   ```
   
   see also https://github.com/apache/jena/issues/1961
   
   ### Relevant output and stacktrace
   
   ```shell
   org.apache.jena.sparql.JenaTransactionException: Tried to write inside a 
READ transaction!
   
        at 
org.apache.jena.sparql.core.mem.DatasetGraphInMemory.mutate(DatasetGraphInMemory.java:378)
        at 
org.apache.jena.sparql.core.mem.DatasetGraphInMemory.addToDftGraph(DatasetGraphInMemory.java:413)
        at 
org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:47)
        at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:147)
        at org.apache.jena.graph.impl.GraphBase.add(GraphBase.java:158)
        at org.apache.jena.sparql.graph.GraphWrapper.add(GraphWrapper.java:40)
        at com.gitlab.sszuev.playjena.GraphTxnTest.test(GraphTxnTest.java:30)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   ```
   ```
   
   
   ### Are you interested in making a pull request?
   
   None


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to