Fork me on GitHub
#datomic
<
2018-02-20
>
Hendrik Poernama05:02:13

hello, anyone knows how to set peer property such as datomic.objectCacheMax with leiningen? Specifically when running a development build using lein run. Leiningen's :jvm-opts doesn't seem to work.

robert-stuttaford05:02:10

@poernahi that’s precisely what we’re doing

robert-stuttaford05:02:32

:jvm-opts ["-server"
             "-Xms3584m"
             "-Xmx3584m"
             "-Ddatomic.objectCacheMax=1792m"
             "-Ddatomic.memoryIndexMax=448m"
             "-Ddatomic.peerConnectionTTLMsec=15000"
             "-Ddatomic.txTimeoutMsec=300000" …]

Hendrik Poernama05:02:07

hmm ok, maybe I formatted it incorrectly

Hendrik Poernama06:02:52

it was working after all. Turns out I was getting memory errors due to missing datomic.memoryIndexMax config. According to the docs https://docs.datomic.com/on-prem/system-properties.html, this should be a transactor property. But it seems to affect peer as well.

Hendrik Poernama06:02:19

As for context, I was trying to configure a development environment using as few memory as possible

Desmond06:02:10

Hi everyone, I would like to do an equality comparison in my query. I got it working when both of the idents I want to compare are present. The issue is that one of the idents is new in the version I'm about to release. If the entities don't have that ident I just want to return false. I'm struggling to come up with the right query to do this. Here's the interesting part of what I have:

[?c :comment/question ?q]
(or-join [?c ?q]
   (not [?c :comment/creator])
   (and
      [?q :question/creator ?question-creator]
      [?c :comment/creator ?comment-creator]
      [(= ?question-creator ?comment-creator) ?from-asker]))

Desmond06:02:35

and this gives me an ArrayIndexOutOfBoundsException

favila06:02:36

?from-asker doesn’t seem meaningful?

favila06:02:27

You don’t need explicit equality check: just unify to same binding

favila06:02:14

[?c :c/creator ?creator][?q :q/creator ?creator]

Desmond07:02:38

@favila I need to return ?from-asker as true/false rather than restrict the set that gets returned

Desmond07:02:41

If I unify to the same binding then I won't get the false ones back

favila14:02:56

Then your “not” branch needs to bind it ani it needs to be included in the or-join bindings. Your error is because of this extra dangling binding

favila14:02:05

This might be clearer with an actual named rule with two impls

Desmond20:02:48

yes, that makes sense. thank you!

chrisetheridge08:02:06

could someone help me? i'm not sure if this is a bug, or something i'm doing incorrectly

chrisetheridge08:02:32

clj
(d/q '[:find ?e .
       :in $ ?uuid
       :where [$ ?e _ ?uuid]]
     (db/db) "5a269adc-72c4-483d-abc4-b9b70707db81")

=> []

(d/entity (db/db)
          [:resource/uuid "5a269adc-72c4-483d-abc4-b9b70707db81"])
=> #{{:db/id ...}}

souenzzo12:02:48

try

[?a :db/unique :db.unique/identity]
[?e ?a ?uuid]

marshall14:02:30

If you change the query to: [$ ?e :resource/uuid ?uuid] do you get a result?

chrisetheridge08:02:50

i assume the first query to return the same entity, as using the entity api

chrisetheridge08:02:58

are we not able to elide attributes like this?

chrisetheridge08:02:04

:resource/uuid is indexed, and unique

donmullen11:02:31

@captaingrover - likely get-else would help get you there - so if :question/creator is the new ident and sometimes doesn’t have value - put [(get-else $ ?q :question/creator "NONE") ?question-creator] in and you’ll get values set - in this case “NONE” - you could set that to be whatever makes sense.

Desmond20:02:18

this is a much easier way to go. thank you for the tip!

favila14:02:23

Also is this actually type string or uuid?

souenzzo15:02:53

I'm trying to get ALL entities from a ref-to-many using pull with :limit nil

souenzzo15:02:09

[{(:user/address :limit nil) [:address/code]}]. But it's returning just 1000 (there is 10000 on my scenario)

jaret20:02:31

@souenzzo would you be able to make a small repo? I ran into this issue before with another client who was unable to share their repo, but was unable to reproduce. I created this repo that showed me that I was able to return all results.

souenzzo20:02:00

yep. I can reproduce. I will do a clj+deps when possible