2013-08-06 47 views
0

我使用neo4j版本1.8.1spring-data-neo4j版本2.2.0. RELEASE春天Neo4j的數據被破壞的每一個數據庫部署

這裏是我的春天的Neo4j CONFIGRATION;

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

    <context:spring-configured/> 
    <context:annotation-config/> 

    <neo4j:config storeDirectory="target/neo4j-db"/> 
    <neo4j:repositories base-package="net.myPackage.core"/> 

    <tx:annotation-driven mode="aspectj"/> 
</beans> 

在其在彈簧上下文(目標/ Neo4j的-DB)中給出的位置處的分貝,正受到破壞,重新創建。所以這是生產中的問題。在每次部署時,都會從neo4j中刪除產品數據,因爲這個問題。

我該如何解決這個問題?有沒有一種狀態可以檢查我可以在春季環境中設置的內容?

回答

2

也許問題storeDirectory?也許它通過您的開發IDE刪除?嘗試將商店目錄移到目標文件夾之外。

+1

你的數據庫目錄在'target'中,這意味着在每個'clean'或deploy任務時都由maven清理。 :) –

+0

謝謝。將目標數據庫路徑移動到另一個目錄是我錯過了:) –