Fork me on GitHub
#datomic
<
2020-05-12
>
hadils02:05:10

Datomic Cloud Question: Does anybody have a way to use Component or Mount to set up database configuration and load parameters? Putting it into the lambda initialization setup does not work. I don't know what to do...

nate12:05:55

Hey, a Datomic noob question, should one call d/connect for every transaction or one can call it once and store a ref to :datomic.client/conn for the whole life cycle of an application, and call d/db per transaction instead ?

nate12:05:42

(Kind of joins @hadilsabbagh18 ‘s question in a way)

marshall12:05:09

Datomic connections do not adhere to an acquire/use/release
pattern. They are thread-safe and long lived. Connections are
cached such that calling datomic.api/connect multiple times with
the same database value will return the same connection object.

marshall12:05:25

that happens to be the api reference for the peer API, but the same is true for client

nate12:05:40

Oh cool that answers my question, thanks @marshall !

hadils13:05:54

@marshall that may be true for the connection, but I have other components in my application., such as parameter loading and channel setup. I still need to use mount

marshall13:05:31

@hadilsabbagh18 yeah, that answer was directed at @nate Managing lifecycle in Ions is a bit different; You need to handle those sort of things in a way that isn’t triggered by ns loading

marshall13:05:32

for example, the Ion tutorial manages db lifecycle outside the push/deploy cycle: https://docs.datomic.com/cloud/ions/ions-tutorial.html#orgf40df0d

hadils13:05:19

@marshall has the parmeters been fixed to handle more than 10 parameters? I rewrote it to handle more than 10 paramaters.

marshall13:05:20

but using AWS parameters directly is the right approach if you have more than 10

marshall13:05:45

that should be available in the cognitect aws-sdk also

hadils13:05:30

Thanks @marshall. So I use my parameters in get-client this is where the problem is...

hadils14:05:04

@marshall Thanks for your help. I got rid of mount and it's working now, after refactoring the code.

joshkh16:05:51

is there a reason to be concerned about a PollingCacheUpdateFailed error in cloud logs? i've checked the troubleshooting documentation but couldn't find an answer.

👍 4