Nov 29th, 2012, 05:16 PM
Is it possible to run Spring Data Neo4J outside of an ApplicationContext
I know there are lots of things that an ApplicationContext does that sets up Spring Data in the initialization phase. But I was wondering if it might be possible to start up Spring Data Neo4J without an ApplicationContext. Maybe not get the nice Repositories from Spring Data, but be able to use the Template and some other mechanisms to access Neo4J.
Basically, on this current project using vert.x we can't start up an ApplicationContext because of how vert.x works with ClassLoaders, which would make us have to create a context per instance, so that could be up to 166 contexts to get it to work. So I was thinking if I could take advantage of the great work in Spring Data Neo4j and leverage it in this environment.
Nov 30th, 2012, 02:10 AM
Hmm good question, you can instantiate a Neo4jTemplate directly and passing in its graphdatabaseservice. That should give you a running version, the only thing that you cannot use is @Transactional then, as this requires the spring tx infrastructure to set up, but you can use template.beginTx().
Nov 30th, 2012, 02:51 PM
But you still need a transactionManager I assume. so instantiating a PlatformTransactionManager implementation in code.