This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-09
Channels
- # aws (4)
- # bangalore-clj (1)
- # beginners (94)
- # boot (19)
- # cider (42)
- # cljs-dev (21)
- # cljsrn (4)
- # clojure (142)
- # clojure-austin (10)
- # clojure-greece (25)
- # clojure-italy (14)
- # clojure-russia (14)
- # clojure-serbia (13)
- # clojure-sg (6)
- # clojure-spec (74)
- # clojure-uk (69)
- # clojurescript (236)
- # consulting (1)
- # cursive (26)
- # data-science (6)
- # datascript (2)
- # datomic (31)
- # editors (5)
- # emacs (24)
- # funcool (5)
- # hoplon (8)
- # jobs-rus (1)
- # luminus (12)
- # lumo (17)
- # off-topic (90)
- # om (45)
- # onyx (5)
- # pedestal (2)
- # powderkeg (12)
- # protorepl (2)
- # re-frame (30)
- # remote-jobs (2)
- # ring-swagger (17)
- # rum (46)
- # slack-help (1)
- # test-check (2)
- # yada (62)
Hello
(d/transact conn (some-fn))
throws: clojure.lang.ExceptionInfo: Interceptor Exception: clojure.lang.LazySeq cannot be cast to java.util.Map
but
(d/transact conn (vec (some-fn)))
works. Is is expected? It's a bug? I'm using lazylist in many other places with no problem
some-fn
is (concat [{:map :form}] (function-that-returns-array-of-db-add))
so I am asking you to verify your assumption that (some-fn)
is truly a lazy-seq of vectors or maps
really that (function-that-returns-array-of-db-add)
doesn't have a lazyseq as one of its items
d/transact
was "traditional" datomic.
(let [a (concat ..)
b (vec a)]
(println "-----")
(println (type a))
(println (class a))
(println (mapv type a))
(println (type b))
(println (class b))
(println (mapv type b))
(println "-----")
a
)
Outputs:
-----
clojure.lang.LazySeq
clojure.lang.LazySeq
[clojure.lang.PersistentArrayMap clojure.lang.PersistentVector clojure.lang.PersistentVector clojure.lang.PersistentVector]
clojure.lang.PersistentVector
clojure.lang.PersistentVector
[clojure.lang.PersistentArrayMap clojure.lang.PersistentVector clojure.lang.PersistentVector clojure.lang.PersistentVector]
-----
@souenzzo have you looked at lower depths? what is the problem with just printing it for yourself and looking?
(defn function-that-returns-array-of-db-add
[x]
(mapcat (fn [a] [[:db/add a b c]]) x)
)
(internal mapcat fn was really returning a tx-data with a single, write as [[:db/add]]..)(d/transact c (concat [{:db/doc "1"}] [[:db/add "2" :db/doc "2"]]))
=>
#object[datomic.promise$settable_future$reify__7008
0x503b2908
{:status :ready,
:val {:db-before datomic.db.Db,
@67615b66 :db-after,
datomic.db.Db @a034e1ff,
:tx-data [#datom[13194139534312
50
#inst"2017-05-09T15:23:29.077-00:00"
13194139534312
true]
#datom[17592186045417 62 "1" 13194139534312 true]
#datom[17592186045418 62 "2" 13194139534312 true]],
:tempids {-9223301668109598144 17592186045417,
"2" 17592186045418}}}]
@souenzzo The reason I say look at the output carefully is I am worried that (vec)
is masking some problem with your tx nested deep somewhere
is anyone running peers in a different AWS region than DynamoDB? Or is that a non-starter?
@csm I would not recommend that. Behavior would be unpredictable with respect to caching and query behavior.