rvesse commented on issue #2195: URL: https://github.com/apache/jena/issues/2195#issuecomment-1892461884
> One more exception. This time "Transactions cannot be nested!" > > ``` > GraphTxn g = new GraphTxn(); > System.out.println(g.find().toList().size()); // if g.size() no exception > > g.begin(TxnType.READ); > System.out.println(g.size()); > g.end(); > ``` > > ``` > org.apache.jena.sparql.JenaTransactionException: Transactions cannot be nested! > > at org.apache.jena.sparql.core.mem.DatasetGraphInMemory.begin(DatasetGraphInMemory.java:149) > at org.apache.jena.sparql.graph.GraphTxn.begin(GraphTxn.java:67) > 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) > ``` In which Jena version? 5.0.0-SNAPSHOT? I guess the returned iterator isn't aware that `toList()` effectively consumes it so it isn't `close()`'d and thus never terminates the automatically begun transaction? -- 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]
