Fork me on GitHub
#datomic
<
2021-08-05
>
zendevil.eth05:08:25

I did create the db with the transactor running, but now I’m getting this:

./bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d humboi,"datomic:"
Execution error (ActiveMQNotConnectedException) at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl/createSessionFactory (ServerLocatorImpl.java:699).
AMQ219007: Cannot connect to server(s). Tried with all available servers.

Full report at:
/var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/clojure-5121092977512187181.edn
prikshetsharma@Prikshets-MacBook-Pro datomic-pro-1.0.6269 % nvim /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/clojure-5121092977512187181.edn
Full report: https://gist.github.com/zendevil/d9f48df00fa243dfcea687f7f1a9d38c

JohnJ15:08:13

Are you using Java 16?

JohnJ15:08:12

the version of activemq that on-prem uses doesn't support it

zendevil.eth15:08:16

not sure:

prikshetsharma@Prikshets-MacBook-Pro datomic-pro-1.0.6269 % java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

zendevil.eth15:08:04

java 8 I think

JohnJ15:08:19

should work, is the transactor running?

zendevil.eth16:08:36

:sql: doesn’t work but :mem: does

zendevil.eth16:08:17

I was running the transactor and the peer on the same port. Now it works

wox13:08:36

I’m wondering what is happening behind the scenes with this query throwing an Execution error (NullPointerException) at datomic.datalog/project (datalog.clj:702).:

(d/q '[:find ?b
       :in $ ?range-start ?range-end
       :where
       [?b :entity/type :entity.type/booking]
       (or-join [?b ?range-start ?range-end ?foobar]
                (and [?b :booking/assignee ?me]
                     [?b :booking/actual-start-time ?booking-start]
                     [(>= ?booking-start ?range-start)]
                     [(< ?booking-start ?range-end)]))]
     (db)
     #inst"2020-01-01"
     #inst"2022-01-01")
There’s a couple of obvious bugs, ?foobar is not bound to anything and neither is ?me , but the weird thing is that having the first two clauses inside the and swapped does not crash. Does anyone know what’s different when they are the other way around?

wox13:08:52

i.e. this works

(d/q '[:find ?b
       :in $ ?range-start ?range-end
       :where
       [?b :entity/type :entity.type/booking]
       (or-join [?b ?range-start ?range-end ?foobar]
                (and [?b :booking/actual-start-time ?booking-start]
                     [?b :booking/assignee ?me]
                     [(>= ?booking-start ?range-start)]
                     [(< ?booking-start ?range-end)]))]
     (db)
     #inst"2020-01-01"
     #inst"2022-01-01")
=> #{[17592186051383]}

wox13:08:23

and so does having the assignee a second time in the end

(d/q '[:find ?b
       :in $ ?range-start ?range-end
       :where
       [?b :entity/type :entity.type/booking]
       (or-join [?b ?range-start ?range-end ?foobar]
                (and [?b :booking/assignee ?me]
                     [?b :booking/actual-start-time ?booking-start]
                     [(>= ?booking-start ?range-start)]
                     [(< ?booking-start ?range-end)]
                     [?b :booking/assignee ?me]))]
     (db)
     #inst"2020-01-01"
     #inst"2022-01-01")

wox13:08:10

and when ?foobar is removed either way works

souenzzo18:08:01

@U7PQLLK0S I'm not from datomic team but it feels like a bug. can you share which datomic version you are using, which kind of connection (mem/file/sql...), maybe the JVM version/release too.

wox07:08:43

this occurred with 1.0.6269 both with sql connection (Linux, JVM 11.0.12) and file connection (macOS, JVM 11.0.10)

wox07:08:06

I tried this now locally with 1.0.6316 as well and the behavior is the same