【发布时间】:2019-12-21 21:49:53
【问题描述】:
我是 Datomic on-prem 的新手。但我无法通过我的编辑调用 d/transact。
我启动了我的对等服务器和我的交易者。
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pensine,datomic:dev://localhost:4334/pensine
bin/transactor config/samples/dev-transactor-template.properties
我已经在我的缓冲区中写了这个
(def cfg {:server-type :peer-server
:access-key "myaccesskey"
:secret "mysecret"
:endpoint "localhost:8998"})
(def client (d/client cfg))
(def conn (d/connect client {:db-name "datomic:dev://localhost:4334/pensine"}))
// Loaded everything above in the REPL then tried to evaluate the expression below.
(d/transact conn {:tx-data [{:db/ident :red}]}) // this throw the error below
@(d/transact conn {:tx-data [{:db/ident :red}]}) // this throw the error below
REPL 输出:
Execution error (IllegalArgumentException) at datomic.client.api.protocols/fn$G (protocols.clj:72).
No implementation of method: :transact of protocol: #'datomic.client.api.protocols/Connection found for class: clojure.lang.Var$Unbound
【问题讨论】: