Apologies for my ignorance re. the above - I discovered I had misconceptions re. the whole Clojure compilation story, getting in the way of understanding. Fixed that now (In particular I hadn’t grasped the dynamic compilation clojure is doing from .clj files to bytecode via ASM - my misconception had been that something like javac had to occur for every piece of clojure code, which isn’t true… - makes much more sense actually, I’d wondered how a lisp image could be maintained that way!).
So, lein jar
does the trick (or e.g. badigeon with tools.deps), for this AOT compile, then we set the env var DATOMIC_EXT_CLASSPATH as per the docs, & restart the transactor.
So it appears I’ve done all that right, except there’s now another problem…
@Marshall Could you confirm that classpath transaction functions are not supported at all via the client api with on-prem? I see that this may have been possible to read into your reply of Dec '18 above, but I went ahead anyway and installed (as far as I can tell correctly) some class path functions into datomic by adding a jar to the classpath.
However, when I try to use the client api to call them, by first requiring in my tx functions library (noting that classpath transaction functions are invoked with the symbol referring to the function, not via a keyword as database functions are), then issuing like:
[my.ns/my-function 1 2 3]
,
I get the response:
"Not supported: class my.ns$my-function"
.
I suspect what may be the case is that, with client, and on-prem, the only way to call a transaction function is of the database function variety (not the classpath variety), and to be able to install those one must use the peer library (which I haven’t yet ventured into, as my getting started experience up to now I have chosen to limit to on-prem and the client api).
If this analysis is correct, I wonder what the most straightforward route forward would be. One option is to introduce the peer library to my on-prem dev setup, else, it looks like I may have to hold off on transaction functions till I migrate wholesale to cloud, as has always looked probable.
Any suggestions would be very welcome.
Thanks, Mike