0

I'm developing a project which is based on Spring Data Neo4j using the repositories approach. The issue is that I can't read and write the graph at the same time (which is required in my app), since I get this error otherwise. My Neo4j server instance is not running but I have different processes which are trying to work with the database (i.e.: the same application context is loaded in different main methods and here should be probably the problem, I don't know). I am used to relational databases and hardly understand this behaviour. Which would be the best approach to get rid of this issue? Or, is it actually possible?

This is part of my application context file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:context="http://www.springframework.org/schema/context"
          xmlns:mongo="http://www.springframework.org/schema/data/mongo"
          xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
          xsi:schemaLocation=
          "http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.springframework.org/schema/data/mongo
          http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/data/neo4j
          http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd">

          <!-- Neo4j -->
          <neo4j:config storeDirectory="/data/production/graph.db"/>
          <neo4j:repositories base-package="org.domain.project.repositories.neo4j"/>

With this context, I'm able to access the neo4jOperations interface in my custom neo4j repository implementation and to build queries without problems. On the other hand, the current user has privileges to access the data folder, so this shouldn't be a problem.

4

1 に答える 1