This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-25
Channels
- # adventofcode (3)
- # aleph (24)
- # architecture (8)
- # beginners (53)
- # boot (34)
- # cider (7)
- # clara (68)
- # cljs-dev (6)
- # cljsrn (3)
- # clojars (10)
- # clojure (71)
- # clojure-germany (2)
- # clojure-italy (10)
- # clojure-nl (25)
- # clojure-serbia (4)
- # clojure-spec (13)
- # clojure-uk (48)
- # clojurescript (31)
- # core-async (62)
- # cursive (13)
- # datomic (4)
- # duct (76)
- # editors (4)
- # fulcro (2)
- # immutant (1)
- # instaparse (1)
- # jobs (1)
- # lein-figwheel (1)
- # mount (1)
- # off-topic (12)
- # onyx (8)
- # re-frame (10)
- # reagent (84)
- # reitit (2)
- # ring (2)
- # shadow-cljs (159)
- # spacemacs (2)
- # specter (17)
- # sql (14)
- # tools-deps (10)
- # yada (15)
Hello, I am using write-bulk-tx-datoms task. The segment that is being written was modeled with an ident named “:segment/id”, this segment/id has the {:db/unique :db.unique/value} attribute. Everything works fine until the segment is replayed (when a crash occurred, for example). The returned exception data :db.error/unique-conflict is thrown as expected and the segment is sent again to the transactor. I believe that it is correct to ignore this segment, but I can’t do that since I can only return :kill, restart and :defer for my handle-exception function. Can I ignore just the :db.error/unique-conflict errors? If not, what do you suggest?
Hmm, yeah, that’s a little tough with respect to unique values
@lboliveira Ahh, that is a tricky one. I’d think we need a patch to write-bulk-tx-datoms
to handle that.
I’m not even sure how you would change it because the whole batch will fail and you may want the other segments to transact
Yeah - hm.
One approach might be to return :restart
and then also check whether those unique values already exist and filter them out.
Another approach might be to stick the unique values in a transactor fn which just ignores that exception when it occurs/or does a similar ignore.
You should use transactor fns sparingly but it might be worth it here for simplicity.
thanks for the reply. You gave me a lot to think about.