datahike icon indicating copy to clipboard operation
datahike copied to clipboard

[Bug]: Connection does not reflect updates to database state made by another connection

Open yflim opened this issue 4 years ago • 0 comments

What version of Datahike are you using?

0.4.0

What version of Java are you using?

java version "16.0.2" 2021-07-20

What operating system are you using?

MacOS

What database EDN configuration are you using?

{:store {:backend :mem, :id (str (UUID/randomUUID))}, :keep-history? true, :schema-flexibility :read}

Describe the bug

(require '[datahike.api :as d]
         '[datahike.test.utils :as dtu])
(def conn1 (dtu/setup-db))
(def conn2 (d/connect (._config (d/db conn1))))
(d/transact conn1 [{:stop/id "foo"}])
(d/datoms @conn1 :eavt)

yields

(#datahike/Datom [1 :stop/id "foo" 536870913]
 #datahike/Datom [536870913
                  :db/txInstant
                  #inst "2022-01-13T22:27:30.615-00:00"
                  536870913])

but

(d/datoms @conn2 :eavt)

yields nil.

What is the expected behaviour?

(d/datoms @conn1 :eavt) and (d/datoms @conn2 :eavt) should give the same value

How can the behaviour be reproduced?

See bug description

yflim avatar Jan 13 '22 22:01 yflim