This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-18
Channels
- # adventofcode (18)
- # announcements (1)
- # asami (99)
- # babashka (4)
- # beginners (45)
- # calva (20)
- # cider (44)
- # cljdoc (5)
- # clojure (66)
- # clojure-australia (2)
- # clojure-europe (36)
- # clojure-nl (11)
- # clojure-norway (4)
- # clojure-seattle (1)
- # clojure-uk (88)
- # clojurescript (37)
- # community-development (8)
- # conjure (8)
- # datascript (4)
- # datomic (29)
- # depstar (12)
- # emacs (7)
- # events (1)
- # fulcro (29)
- # graalvm (4)
- # graphql (2)
- # helix (2)
- # integrant (4)
- # jobs (7)
- # jobs-discuss (1)
- # lsp (3)
- # malli (6)
- # off-topic (61)
- # pathom (67)
- # pedestal (3)
- # re-frame (9)
- # reitit (4)
- # remote-jobs (13)
- # reveal (18)
- # shadow-cljs (59)
- # spacemacs (1)
- # sql (7)
- # startup-in-a-month (1)
- # tools-deps (29)
- # vim (12)
Hi there another question for this helpful group. I am trying to understand how to pass jdbc transactions to components like "repositories". It would mean replacing the db spec that I pass in at runtime but after the injection happens...thoughts?
I am also using duct here and I wonder if modules could be used in order to augment the component with the transaction object before injection
I am also using duct here and I wonder if modules could be used in order to augment the component with the transaction object before injection
I recommend that you always pass the DB connection as a parameter to your repository functions. Inject your connection pool as close to the "input" side of your application. In a web app, I would inject it into the request object in a middleware. Then you can handle transactions normally (as in jdbc/with-db-transaction).
yeah the thing is we currently have a layer on top of the repositories...services and those gets the db injected and I am thinking of using with-transation
within them...but then the repo's db has to come from them directly