Fork me on GitHub
#sql
<
2022-03-30
>
Leonid Korogodski00:03:07

I don't think it has to do with that. It's fine to pull chunks of data (by a small number of rows, say, 4000), so long as we expose them as an iterator and discard the processed ones from memory. The problem is that they stay in memory.

hiredman01:03:43

Are you closing the cursors?

Leonid Korogodski01:03:08

I can't use with-open, though. The cursors are closed inside .onComplete of the Scala future returned when the flow graph begins to run.

Leonid Korogodski01:03:32

Otherwise, they'd be closed before the flow is done.

Leonid Korogodski02:03:38

Huh, interesting. Thanks!

Leonid Korogodski02:03:27

Hmm, but opts in my code above is actually {:fetch-size 4000}, anyway.

Leonid Korogodski03:03:10

Just need auto-commit.

bnstvn13:03:08

basic question — in next-jdbc can i express somehow that i want to get back long instead of BigDecimal? eg.

(jdbc/execute! (jdbc/get-connection {:dbtype "oracle" ,,, }) ["select 1 from dual"])
=> [{:1 1M}]
(the types namespace seems only for input coercion?)

dharrigan13:03:13

Perhaps working with might shed some light?

🙏 1
dharrigan13:03:54

I don't work with any oracle db's but I suppose controlling how next jdbc converts each column into the appropriate type could be handled here.