Fork me on GitHub
#datomic
<
2018-09-06
>
cap10morgan00:09:13

Does a transactor failover event count as "restarting it" for the purposes of what the docs recommend after doing a restore?

jaret02:09:47

Yes, HA failover would work for a restore. However, I have to ask, did the “primary transactor fail during restore?

cap10morgan03:09:47

no it didn't. this is just a planning hypothetical. thanks jaret!

ninja12:09:05

Hi, when I want to call a custom function (A) from within a database function (B) what is the recommended way of doing so? Should one install A as a database function and call it via invoke from within B or let B require it using :requires and call it like any other function?

val_waeselynck13:09:29

Depends on whether A is on the classpath

ninja13:09:34

So let's say A is not on the classpath. In this case installing the function as a database function would allow me to call it from B, right?

val_waeselynck13:09:48

Yes via d/invoke

4
ninja13:09:08

Ok. So, if on the other hand it is on the classpath it should be made accessible to B using :requires and call it in a "normal" fashion.

ninja13:09:25

So is it recommended to split database functions into smaller functions using either of these approaches? This would be pretty neat, since a named function contributes to better readability and it could be re-used.

stuarthalloway14:09:38

@U8MH51GHZ unless you have a specific reason to install database functions (e.g. managing the classpath is operationally challenging) I would prefer classpath functions. https://docs.datomic.com/on-prem/database-functions.html#classpath-functions

👍 4
4
ninja14:09:10

@U072WS7PE this is a valid reason. But this requires me to have control over the transactor (i.e. how it is started)

johnj15:09:09

How does the transactor knows of a classpath function that is added to the peer? or it doesn't have to know in this case?

stuarthalloway16:09:28

classpath management is up to you, put things on the classpath for processes where you need them