> On Jun 23, 2017, at 2:26 PM, Sean Corfield <s...@corfield.org> wrote:
> 
> This is excellent news as far as I’m concerned because it shows there’s no 
> specific bug in clojure.java.jdbc that is fundamentally causing the OOM 
> problem you’re seeing!

I'm relieved too, given that I use clojure.java.jdbc extensively :) 

> (that’s not to say there aren’t _other_ bugs in clojure.java.jdbc and the 
> idea of the reducible result set definitely has appeal, which is why there’s 
> a JIRA issue for it, but it doesn’t appear to be necessary in this instance).

I've been trying to find a use case for the reducible result set, other than 
avoiding the memory issues I was experiencing, and there aren't too many that 
spring to mind. Probably the main one is mentioned in the JIRA, which is 
cleaning up clojure.java.jdbc internals. You could drop the need for sprinkling 
 ^:once everywhere.

One idea: as we have the constraint that regular result sets cannot be passed 
around, and must be consumed entirely in the context of their JDBC connection, 
perhaps they could be wrapped somewhat like `eduction` and represent the 
'recipe' for a query. At the start of reduce/iterator it would attempt to 
execute the query it owns. That would be kind of handy. Such a thing could be 
passed around to reduce or transduce, and would implement IReduceInit and 
clojure.lang.Sequential (apropos post from Alex: 
http://insideclojure.org/2015/01/18/reducible-generators/)

Another option that achieves similar goals is simply feeding the results to a 
channel. I seem to code this up myself on every new project :) 
clojure.java.jdbc internals could handle the bookkeeping of keeping the 
ResultSet alive until fully consumed, at which point the channel is closed. I'm 
sure this isn't the first such request, and that there are probably good 
reasons for it not having happened as yet.

Luke.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to