Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure Datomic:Can';t从REPL计算d/transaction_Clojure_Datomic - Fatal编程技术网

Clojure Datomic:Can';t从REPL计算d/transaction

Clojure Datomic:Can';t从REPL计算d/transaction,clojure,datomic,Clojure,Datomic,我是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 我已经把它写在我的缓冲区里了 (def cfg {:server-type :peer-server :a

我是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
我已经把它写在我的缓冲区里了


(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
答复:

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

在我的dev-In-memory设置中,我使用参数启动对等服务器

-d pensine,datomic:mem://pensine
并使用

(def conn (d/connect client {:db-name "pensine"}))
在此设置中,您不需要事务处理程序

希望有帮助,我还没有做过更全面的设置

(def conn (d/connect client {:db-name "pensine"}))