sszuev commented on issue #1961: URL: https://github.com/apache/jena/issues/1961#issuecomment-1642133177
> Could you expand on that? Why "can't"? There are various problems that arise that ACID transactions address. Protecting the graph datastructures is one part of that - having a consistency view of the data is another. OWLAPI provides R\W locking mechanism, so we should also support this functionality in ONTAPI, we already has concurrent `OWLOntoloty`, so it would be nice have protected RDF-view. Transactions can be used by those who use this library - ONTAPI is just advanced wrapper of RDFGraph, a view. So no problem for clients to make their own transaction protection. I think providing that functionality would be out of scope, ONTAPI is intended for OWL2 only. > These seem to protect individual operations but not a sequence of operations (the A in ACID). E.g. adding several triples. So datastructure are protected but application can see half-completed changes. You can comment out this method and run tests. I think the tests will fail. Method `remember` creates Wrapper for iterator (`OuterTriplesIterator`) with it is own lock (`ReentrantLock`, not the outer `ReadWriteLock`), it protects `next` & `hasNext` & `close`. When there is a write operation, this lock plays its role, see `releaseToSnapshot`. When this happens (the iterator is collected to snapshot, `List`), all other iterators continue to run until their turn comes. After some iterator "released to snapshot" (i.e. collected to snapshot, `List`), nothing block it from further iteration. Whole write operation is protected by RW lock, so no new iterators will appeared (creation of iterator is a read operation). But off course there could be mistakes and possible improvements, this implementation can be considered as a draft. (Honestly, I'm not sure if anyone is using this feature, but it should be in the ONT-API library for compatibility with OWLAPI-impl) > These seem to protect individual operations but not a sequence of operations (the A in ACID). E.g. adding several triples. So datastructure are protected but application can see half-completed changes. yes, there is an issue about protection RDF-Model view: https://github.com/owlcs/ont-api/issues/46 Also, I consider RW-Graph as a collection, similar to `java.util.concurrent.CopyOnWriteArrayList` but for RDF. So yes, it is not about ACID (only A). -- 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]
