This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-24
Channels
- # announcements (10)
- # aws-lambda (9)
- # babashka (14)
- # beginners (166)
- # calva (63)
- # chlorine-clover (4)
- # cider (40)
- # cljs-dev (4)
- # clojure (182)
- # clojure-europe (18)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-spec (17)
- # clojure-uk (55)
- # clojurescript (11)
- # core-async (12)
- # cursive (23)
- # datascript (5)
- # datomic (19)
- # emacs (4)
- # fulcro (46)
- # graalvm (2)
- # hoplon (2)
- # joker (3)
- # juxt (1)
- # keechma (2)
- # leiningen (20)
- # malli (1)
- # meander (7)
- # nrepl (1)
- # off-topic (72)
- # pedestal (6)
- # re-frame (15)
- # reitit (7)
- # shadow-cljs (34)
- # sql (14)
- # testing (14)
- # tools-deps (11)
- # tree-sitter (1)
- # vim (14)
- # xtdb (19)
- # yada (3)
if an ion fetches an ssm
parameter as in the event-example
: https://github.com/Datomic/ion-event-example/blob/master/src/datomic/ion/event_example.clj#L40-L48
(def get-params
,,,
(memoize #(,,, (ion/get-params ,,,))))
when can you expect that to get recomputed? e.g. after next deployment, after next upgrade, never, etc.?@nolan If you've memoized that function like that it'll update each time the process is cycled so an ion deploy will work to refresh. ion/get-params
is just a wrapper around https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_GetParametersByPath.html if you want more details
Although it might be a better idea just to write your own version. Be careful about exceeding 10 http://p.ararameters per deploy group, your app might explode if you don't explicitly work around the 10 results limit in this API call, as last I remember ion/get-params
does not implement the logic to keep calling next-token until all params are fetched.
ah! really appreciate the input @eagonmeng. affirms my suspicions (and hopes, desires, etc. π), and makes a lot of sense. also appreciate the additional info re: parameter limit, wont be relevant here, but super good to know.
as a slightly tangential follow-up, does memoizing the call to ion/get-env
make any material difference? or is that an in-process access anyway (only really worried about production, if that matters)?
https://softwareengineeringdaily.com/2020/03/24/datomic-architecture-with-marshall-thompson/ (little shameless self promotion π )
Query question: I have an entity called Interaction with an attribute called :devices
which is of cardinality many. Those devices are eids. Given a device eid, I'd like to check to see if that device eid appears in an Interaction's :devices
and then return all the other device eids. Here's what I have so far:
'[:find ?devices
:in $ ?dev-eid
:where
[?interaction :devices ?dev-eid]
[?interaction :devices ?devices]
]
However the problem is that my original ?dev-eid
is also inside ?devices
. I could filter it out after the query, but I feel like it would be better practice to include that filtering in the query (correct me if I'm wrong on that). Additional info: there are only ever 2 eids in any :devices
. How can I remove ?dev-eid
from ?devices
inside my query? Something like "grab all ?devices
which are not equal to ?dev-eid
".Perfect thank you @U09R86PA4! One more (I think) simple thing. I end up only getting a single ?device when I do this. However if I return ?devices ?interaction
I end up getting the 4 that I expect (but they are each paired with the ?interaction eid I don't want). It seems like the query just grabs the first one and returns it. How can I have it grab them all?
query normally returns sets, so if the same device appears 4 times it wonβt matter, you will get one device
you can either include :find ?interaction
to get the devices per interaction, or use :with ?interaction
to include it for the set but then have it removed before returning. queryies with :`with` do not return sets
You were right! The same device appeared multiple times. The data model was slightly different than I expected. I'm getting exactly what I want now =]
Hi.
I'm running datomic-pro-0.9.5697
local transactor and then datomic.peer-server
and then datomic.client.api/connect
to make the actual connection.
It's been working fine for ages; but I've just started to see
Reflection warning, cognitect/hmac_authn.clj:80:12 - call to static method encodeHex on org.apache.commons.codec.binary.Hex can't be resolved (argument types: unknown, java.lang.Boolean).
Reflection warning, cognitect/hmac_authn.clj:80:3 - call to java.lang.String ctor can't be resolved.
warnings and now
Caused by: clojure.lang.ExceptionInfo: No name matching localhost found
{:cognitect.anomalies/category :cognitect.anomalies/fault, :cognitect.anomalies/message "No name matching localhost found", :cognitect.http-client/throwable #error {
:cause "No name matching localhost found"
:via
[{:type .ssl.SSLHandshakeException
:message "No name matching localhost found"
:at [sun.security.ssl.Alert createSSLException "Alert.java" 128]}
{:type java.security.cert.CertificateException
:message "No name matching localhost found"
:at [sun.security.util.HostnameChecker matchDNS "HostnameChecker.java" 225]}]
:trace
[[sun.security.util.HostnameChecker matchDNS "HostnameChecker.java" 225]
[sun.security.util.HostnameChecker match "HostnameChecker.java" 98]
[sun.security.ssl.X509TrustManagerImpl checkIdentity "X509TrustManagerImpl.java" 459]
...
at datomic.client.api.async$ares.invokeStatic (async.clj:56)
datomic.client.api.async$ares.invoke (async.clj:52)
datomic.client.api.sync.Client.connect (sync.clj:71)
datomic.client.api$connect.invokeStatic (api.clj:118)
datomic.client.api$connect.invoke (api.clj:105)
errors
I'm not aware of changing anything; the SSLHandshakeException makes me wonder if some certificate has expired.
I don't see any errors reported on the transactor log or in the peer server consoleoh I just found https://forum.datomic.com/t/ssl-handshake-error-when-connecting-to-peer-server-locally/1067/7
Hmmm, naively adding
:validate-hostnames false
didn't seem to helphaven't tried updating datomic binaries though
just for reference, I am trying this
(datomic.client.api/connect
(datomic.client.api/client {:server-type :peer-server,
:access-key "myaccesskey",
:secret "mysecret",
:endpoint "localhost:8998",
:validate-hostnames false})
{:db-name "xiangqi"
:validate-hostnames false}
)
and I get
Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:56).
No name matching localhost found
updating from
com.datomic/client-pro {:mvn/version "0.8.28"}
to
com.datomic/client-pro {:mvn/version "0.9.43"}
seems to have done the tricktransactor/peer server did not need upgrading; just the client