Hi, after a bit of struggling with Maven I'm now able to run an application using an embedded Stardog.
Now I'd like to attach a transaction listener to it.
I see there is a good example here: stardog-examples/examples/connectable at develop · stardog-union/stardog-examples · GitHub however I cannot understand how to attach the listener to the embedded instance of Stardog I just created. I see the example uses a guice to inject the the listener but the missing part is how to use the injector configured with this module: ExampleModule.java.
Should the injector configured with that module return a Connection, an AdminConnection?
Do you have a simple two-liners to show how to use it?
I don’t believed that the listener is defined for a specific connection but listens on all connections. It will be looked up my the service definition and injected. There shouldn’t be anything specific you need to do for embedded mode. It’s all automagic.
The example you refer to is for an embedded connection already. You need the Guice module definition as in that example but do not need to create an injector explicitly which is done by Stardog internals. You need the service loader file [1] so Stardog will include use your Guice module.