Sorry for not full description!

Thanks Andy and Rob for quick answers!

>From code that I show below, I expect next:
 - Read all "name" fields from MY_TDB, do some calculations with this
"name" and save results to MY_TDB.
   The full work sequence is next: read "name" field -> do calculaions ->
save results -> read next "name" -> do calculaions -> save results -> ...

But this code after running gives me next exception:
Exception in thread "main" java.util.ConcurrentModificationException:
Iterator: started at 8, now 9
at
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW.policyError(DatasetControlMRSW.java:157)
at
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW.access$000(DatasetControlMRSW.java:32)
at
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW$IteratorCheckNotConcurrent.checkCourrentModification(DatasetControlMRSW.java:110)
at
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW$IteratorCheckNotConcurrent.hasNext(DatasetControlMRSW.java:118)
at org.apache.jena.atlas.iterator.Iter$4.hasNext(Iter.java:318)
at org.apache.jena.atlas.iterator.Iter$3.hasNext(Iter.java:201)
at org.apache.jena.atlas.iterator.Iter.hasNext(Iter.java:942)
at
org.apache.jena.atlas.iterator.RepeatApplyIterator.hasNext(RepeatApplyIterator.java:59)
at
com.hp.hpl.jena.tdb.solver.SolverLib$IterAbortable.hasNext(SolverLib.java:191)
at org.apache.jena.atlas.iterator.Iter$4.hasNext(Iter.java:318)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterPlainWrapper.hasNextBinding(QueryIterPlainWrapper.java:54)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:112)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:40)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:112)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:40)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:112)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:40)
at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:112)
at
com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:75)
at
com.hp.hpl.jena.sparql.engine.ResultSetCheckCondition.hasNext(ResultSetCheckCondition.java:59)
at
com.github.hronom.test.jena.TestTdbTransactionsReadWrite.main(TestTdbTransactionsReadWrite.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

And I accept this error and I already use method that Andy Seaborne writes
here https://issues.apache.org/jira/browse/JENA-1006
Iterator<Triple> iter = graph.find(...).toList().iterator();

But looks like this method "hungry for memory" and I'm look for efficient
way(low memory consumption) method to do this stuff.

Maybe similar questions can explain more then me(sorry for links to other
sources):
http://stackoverflow.com/questions/10165096/jena-tdb-nested-transactions
http://answers.semanticweb.com/questions/15852/jena-tdb-nested-transactions

And sorry for my bad english=(

Reply via email to