funcool / funcool/clojure.jdbc
Docs: clarify cursor behavior
- Ngôn ngữ chính
- Clojure
- Star
- 106
- Fork
- 23
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Using clojure.jdbc w/ Hikari CP and Postgresql 11.
When attempting to create a cursor as described in the docs the process still ends up trying to load the whole result set into memory.
``` clojure
(def conn (jdbc/connection pool))
(def cursor (jdbc/fetch-lazy conn "SELECT \"uuid\", data_bytes FROM visitor_data;"))
(def cursor-seq (jdbc/cursor->lazyseq cursor)) ;; hangs here
```
If I explicitly set auto-commit and the fetch size I don't have that problem:
``` clojure
(def conn (jdbc/connection pool))
(def cursor (jdbc/fetch-lazy conn "SELECT \"uuid\", data_bytes FROM visitor_data;"))
(.setFetchSize (.-stmt cursor) 50)
(.setAutoCommit (.getConnection (.-stmt cursor)) false)
(def cursor-seq (jdbc/cursor->lazyseq cursor))
```
is this a documentation problem or is the library expected to modify those settings for us?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.