I’m trying to use a classpath function as a transaction function, but I’m not having any luck so far. I’m using Datomic Starter Edition in a Docker container is this case.
What I’ve done is:
- Put Datomic in
- Package up my functions as a single clj file (
libdomains.clj), which is in a jar file (
libdomains.jar). I put the jar file in
/opt/datomic-pro-1.0.6269/lib. The clojure file contains
(ns libdomains ...)and defines a function
- I set
ENV DATOMIC_EXT_CLASSPATH=/opt/datomic-pro-1.0.6269/lib/libdomains.jarin my Dockerfile.
- Build and run my container.
- Start a dev transactor, create a database, and start the peer server.
- Attempt to transact
[[libdomains/put-object args...]]via a peer server connection (I’m not using Clojure on the client side, so this requires using the peer server).
I keep getting an error
Unable to resolve data function: libdomains.put-object. If I start up the datomic repl, I can
(require 'libdomains) and use the function that way, so it seems to be on the classpath. Any ideas on what I can debug next? The documentation seems to indicate that this was all I needed to do.