On Fri, Jul 12, 2013 at 9:18 PM, Andy Seaborne <[email protected]> wrote: > On 10/07/13 16:59, Reto Bachmann-Gmür wrote: >> >> Could it be that Jena methods return before that jena has actually >> finished writing and that the jena buiilt-in locks take this into >> account? > > > No - they don't do that. Iterators (obviously) resume on teh next .hasNext > etc so iterator - operation - iterator is a potential problem area. > > Could there be separate accesses to two graphs in the same dataset?
That's exactly the point. This test (http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedTest.java) runs on a single graph. Locks (standard java locks) ensure that no two threads write two the graph concurrently and that no thread readys from the graph while another thread is having write access. Even worse, the first exception described in CLEREZZA-792 and the one quoted in this thread occur after all threads that perform some write operation have ended. > Can you use transactions? Then you don't need locking. Maybe. But it still should work by only having concurrent read-operations and no other operation during writes. Cheers, Reto
