Was a conclusion ever reached on this issue? Is the mistake here having reifying a map facade over a mutable connection that is then combined with resource-managing reducers? Or is it inherent transducers and reducibles?
Iām asking because Iād like to offer similar affordances to next.jdbc but also avoid recreating this issue in a similar API Iām building; one that works over RDF data sources, not JDBC ones.
What do you mean by "this issue" cause we covered quite a bit of ground š
There was clear consensus that my proposed change to select-keys
was a bad idea - for several reasons in the end.
And my discussion was nothing to do with next.jdbc
by the way.
@alexmiller In a ticket from clojure.data.json I saw you mentioned: > Can you switch from using hash-map when constructing the option maps to array-map? If it's not already faster now, it likely will be in 1.11 Is there more info on why array maps would be faster in 1.11? Interested!
1š7š2šApologies I meant this (from the next.jdbc
) docs:
> Note: you need to be careful when using stateful transducers, such as partition-by, when reducing over the result of plan. Since plan returns an IReduceInit, the resource management (around the ResultSet) only applies to the reduce operation: many stateful transducers have a completing function that will access elements of the result sequence -- and this will usually fail after the reduction has cleaned up the resources. This is an inherent problem with stateful transducers over resource-managing reductions with no good solution.
Which is what I thought @hiredman was referring to here: https://clojurians.slack.com/archives/C06E3HYPR/p1623971622083700?thread_ts=1623971154.083300&cid=C06E3HYPR
There were some changes as part of the trailing map stuff and I think Rich and Fogus had ideas about more, but Iām not sure where all that landed
1š¤ÆYes, he was referring to that, but that what wasn't what my discussion in #clojure-dev was about -- and his comment was just pointing out a use case that would actually be broken by my proposal for select-keys
.
As for your question, I don't think there's anything more to add over what is in the next.jdbc
docs: "This is an inherent problem with stateful transducers over resource-managing reductions with no good solution."