Results 1 to 3 of 3

Thread: Is it possible to run Spring Data Neo4J outside of an ApplicationContext

  1. #1
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default 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. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    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().

  3. #3
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

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

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •