Sean Corfield <s...@corfield.org> writes:

> Did you try this:
>
>     (jdbc/with-db-connection [conn config/db]
>       (.setAutoCommit (jdbc/db-find-connection conn) false)
>       (into [] (take 2) (jdbc/reducible-query conn query {:fetch-size 500}))
>
> (I don’t have your sort of data set to test on with PostgreSQL)

Hi Sean,

that didn't work, i.e. I got an OutOfMemoryError. Even if it did, it
uses a lot of boilerplate code and looks rather 'pale' in comparison to

    (into [] (take 2) (jdbc/reducible-query conn query {:use-streaming? true}))

It would also be nice from a callers perspective since he does not need
to know if the query should use streaming; it would be part of the
options passed to reducible-query.

I think it would make sense to add support for streaming into java.jdbc.

I'm not sure if this is feasible.

The required steps to setup streaming are different from database to
database and I guess they may change with the driver version being used.

I think you would need some functionality to let the user hook into the
process of setting up a connection for streaming. Though java.jdbc could
provide those hooks for some commonly used databases.

-- 
Cheers
Ralf

-- 
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