Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to run Spring Data Neo4J outside of an ApplicationContext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    Thanks

    Mark

  • #2
    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().

    Comment


    • #3
      But you still need a transactionManager I assume. so instantiating a PlatformTransactionManager implementation in code.

      Mark

      Comment

      Working...
      X