This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-18
Channels
- # aws (1)
- # babashka (35)
- # beginners (52)
- # biff (4)
- # calva (55)
- # cider (19)
- # clojure (54)
- # clojure-dev (3)
- # clojure-europe (23)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-uk (2)
- # clojurescript (9)
- # code-reviews (3)
- # datahike (1)
- # fulcro (1)
- # funcool (4)
- # graalvm (21)
- # gratitude (2)
- # java (5)
- # jobs (2)
- # joyride (1)
- # kaocha (13)
- # malli (2)
- # off-topic (22)
- # other-languages (11)
- # pathom (4)
- # re-frame (35)
- # reagent (3)
- # reitit (3)
- # releases (2)
- # remote-jobs (1)
- # rum (1)
- # shadow-cljs (42)
- # sql (18)
- # tools-deps (72)
- # web-security (6)
- # xtdb (15)
GM friends, has anyone seen this problem? I’m trying to migrate from korma to next.jdbc, I added the last next.jdbc build to my project.clj and started my REPL using clojure 1.9.0. Then I’m adding a new namespace requiring next.jdbc and when I try to evaluate that ns I’m getting this exception
CompilerException java.io.FileNotFoundException: Could not locate clojure/datafy__init.class or clojure/datafy.clj on classpath., compiling:(next/jdbc/result_set.clj:1:1)
Any thoughts ?I think clojure.datafy was introduced after 1.9.0 https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.847/doc/getting-started#installation: > You must be using Clojure 1.10 or later.
For what it's worth we recently (couple of months ago) upgraded from 1.9.0 to 1.11 and it went very smoothly so I highly recommend it!
Yes it is there. I missed that small detail 😅 Thanks. My problems now are bigger than just migrating korma.
Clojure is very stable and backwards compatible; it's unlikely that you'll have any (serious) issues, should you choose to upgrade 🙂
I just did it, all good so far. Thanks
@ULP19F687 For what it's worth, Clojure's new versions are typically so stable and so backward compatible that we generally run even the alpha releases in production as soon as they appear.
(and all my projects are typically tested on multiple versions of Clojure -- next.jdbc
is tested against 1.10, 1.11, and the master snapshots, i.e., what will become 1.12 -- https://github.com/seancorfield/next-jdbc/blob/develop/build.clj#L22-L27 )
Thank you @U04V70XH6
btw do you know how to share a connection pool between korma and next.jdbc? or where should I start digging?
Never used Korma. It's always been too "ORM-y" for my taste.
Mine too ¯\(ツ)/¯
It doesn't look easy to share Korma's DB stuff outside it... it has an atom for the default and then two global dynamic Vars... and I haven't yet figured out whether it always uses a connection pool or how it uses that 🙂
Exactly! There’s nothing to get that pool outside the defdb
😞
And it uses the old java.jdbc
style hash maps with :subprotocol
etc which isn't supported at all in next.jdbc
😞
I added a :jdbcUrl
to the spec but if next.jdbc
doesn’t support :subprotocol
that makes impossible to share the connection pool, and I was getting an error about it.
Korma even duplicates a lot of the DB-specific machinery that is in (legacy) java.jdbc
code... I think you may just be better off creating your own pool for use with next.jdbc
(and I would recommend switching to HikariCP -- it's much better maintained and works better than c3p0).
I was absolutely thinking about switching to HikariCP, which I’ve used before. Thanks