Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rdf4j-dev] potential iterator leak in repository handling?


On Fri, 7 Apr 2023, at 11:14, Matthew Nguyen via rdf4j-dev wrote:

But what's the advantage of forcing models through a different triples interface than others? Seems simpler to treat all triples fetch the same no?

What do you mean with "forcing models through a different triples interface"? Different from what? The Repository interface?

They serve fundamentally different purposes. While both are intended to access RDF statements, one is for accessing RDF databases in a transactional/scalable manner, the other is for easily working with (small) data collections in memory.


Unless models data is calculated on the fly, there's an expectation that it's persisted or loaded from somewhere which has potential baggage. 

Perhaps I'm overlooking something that you may have mentioned earlier, but that seems strange to me. I don't dispute that the contents of models is often (not always) "loaded from somewhere", but the responsibility for making sure there are no resource leaks is with whichever bit of code is doing that loading. It's not the job of the Model class or its related utilities - these are just in-memory receptacles of the data.

This is no different from getting, say, a large sequence of integer numbers from an SQL database and sticking them all in an ArrayList - making sure the SQL connection gets closed is not the job of the ArrayList.

Jeen


Back to the top