インメモリ データベースを定義する Clojure ns があります。1 つのパーティション、いくつかの属性、および 2 つのエンティティです。Eclipse (反時計回り) から実行すると、結果 ( exception ) は次のようになります。
;; Clojure 1.4.0
;; Switching to ww.billing namespace
#'ww.billing/cardinality
#<Namespace ww.billing>
=> (setup-db)
#<HashSet [[:billing]]>
#<HashSet [[:db/code], [:customer/taxid], [:fressian/tag], [:db/unique], [:db/fn],
[:customer/role], [:db/noHistory], [:db/fulltext], [:db/lang], [:db/valueType],
[:db/doc], [:db/isComponent], [:db.install/function], [:db/cardinality],
[:db/txInstant], [:db/index], [:customer/taxname]]>
#<HashSet [["BBB010101BB1"], ["AAA010101AAA"]]>
#<HashSet [[272678883689455], [272678883689454]]>
nil
=> (cardinality mdb :customer/taxid)
IllegalArgumentException Cannot resolve key: :customer/taxid
datomic.datalog/resolve-id ( datalog.clj:144)
それでも、同じコードの LightTable からは、もちろん、結果は異なります (正しい):
(ns ww.billing) => nil
(setup-db) => nil
(cardinality mdb :customer/taxid) => :db.cardinality/one
Output:
#<HashSet [[:billing]]>
#<HashSet [[:db/code], [:customer/taxid], [:fressian/tag], [:db/unique], [:db/fn],
[:customer/role], [:db/noHistory], [:db/fulltext], [:db/lang], [:db/valueType],
[:db/doc], [:db/isComponent], [:db.install/function], [:db/cardinality],
[:db/txInstant], [:db/index], [:customer/taxname]]>
#<HashSet [["BBB010101BB1"], ["AAA010101AAA"]]>
#<HashSet [[272678883689455], [272678883689454]]>
環境によって結果が異なる原因は何ですか? 注: IntelliJ は Eclipse のように動作しました。カーディナリティ関数は、シアトルのデモから取得されます。