You said:

But when the database is already connected like in

  (jdbc/with-db-connection [db db]
    (jdbc/query db
                query
                {:result-set-fn (fn [coll] (doall (take 2 coll)))
                 :fetch-size 100
                 :auto-commit? false}))

streaming is not turned on.

Well, of course not: you didn’t tell with-db-connection to do it:

  (jdbc/with-db-connection [db db {:auto-commit? false}]
    (jdbc/query db
                query
                {:result-set-fn (fn [coll] (doall (take 2 coll)))
                 :fetch-size 100 }))

You have to pass the option into the call that would create the connection.

Also, can you confirm that reducible-query also works like this for you?

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

From: Ralf Schmitt
Sent: Thursday, July 6, 2017 5:19 AM
To: Sean Corfield; Clojure Mailing List
Subject: Re: JDBC Connection auto-commit?: [ANN] clojure.java.jdbc 0.7.0 Beta1

Ralf Schmitt <r...@systemexit.de> writes:

> Sean Corfield <s...@corfield.org> writes:
>
>> The :auto-commit? option is supported in 0.7.0-beta5 which should hit
>> Maven Central by tomorrow (or maybe late tonight). Please let me know
>> if it solves the streaming problem.
>
> yes, it does work. Thanks.

Sorry, but that's not entirely true.

db is map/db-spec for a postgresql database in the following code:

The following does work:

  (jdbc/query db
              query
              {:result-set-fn (fn [coll] (doall (take 2 coll)))
               :fetch-size 100
               :auto-commit? false})

But when the database is already connected like in

  (jdbc/with-db-connection [db db]
    (jdbc/query db
                query
                {:result-set-fn (fn [coll] (doall (take 2 coll)))
                 :fetch-size 100
                 :auto-commit? false}))

streaming is not turned on.

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