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?

Think some context may have been lost along the way but I'm referring to models.getstatements() returning an iterator that is not AutoCloseable.  If I decide to store my models in a db, I either have to load all my models data into memory or risk an iterator leak if I decide to fetch directly from my db.  



On Thursday, April 6, 2023 at 07:42:43 PM EDT, Jeen Broekstra <jeen@xxxxxxxxxxxx> wrote:



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

_______________________________________________
rdf4j-dev mailing list
rdf4j-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/rdf4j-dev

Back to the top