You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For convenience at a REPL we've always allowed you to call query etc on a Repository object directly. However doing so leaks a RepositoryConnection resource, which can cause serious and hard to find bugs in production.
We should remove the extensions of these functions to Repository, and instead raise an error telling people to change to call the function on the result of (->connection repo) not repo itself, and wrap in a with-open
This has been a common bug in code, hopefully this will improve the situation; though we also need to encourage more eager processing of queries (See #104).
The text was updated successfully, but these errors were encountered:
Clients who receive this exception should adopt a pattern migrating
code from this:
(let [repo (repo)]
(query repo "select * where { ?s ?p ?o .} limit 10")
)
To something more like this:
(let [repo (repo)]
(with-open [conn (->connection repo)]
(doall (query conn "select * where { ?s ?p ?o . } limit 10"))))
We plan to add more eager APIs to assist with this in the future.
For convenience at a REPL we've always allowed you to call query etc on a Repository object directly. However doing so leaks a
RepositoryConnection
resource, which can cause serious and hard to find bugs in production.We should remove the extensions of these functions to Repository, and instead raise an error telling people to change to call the function on the result of
(->connection repo)
notrepo
itself, and wrap in awith-open
This has been a common bug in code, hopefully this will improve the situation; though we also need to encourage more eager processing of queries (See #104).
The text was updated successfully, but these errors were encountered: