我有一個neo4j獨特的約束有點麻煩,其中由於節點已經存在,CREATE cypher語句無法執行。問題是,它不(存在)。此外,這個確切的過程與這個確切的數據昨天工作。Neo4j 2.0獨特的約束錯誤「節點已經存在」,當它不
我的neo4j版本是Ubuntu 12.04.3上的社區2.0.0(發行版)。這是我目前的狀況:
我的約束:
[email protected]:~$ neo4j-shell
neo4j-sh (?)$ schema
Indexes
ON :ConsumerUser(tokens) ONLINE
ON :Id(uuid) ONLINE (for uniqueness constraint) #relevant
ON :User(email) ONLINE (for uniqueness constraint)
ON :User(username) ONLINE (for uniqueness constraint)
Constraints
ON (user:User) ASSERT user.email IS UNIQUE
ON (user:User) ASSERT user.username IS UNIQUE
ON (id:Id) ASSERT id.uuid IS UNIQUE #relevant
:Id.uuid應該是唯一的。
我沒有任何數據:
neo4j-sh (?)$ dump
begin
create index on :`ConsumerUser`(`tokens`);
create index on :`Id`(`uuid`);
create index on :`User`(`email`);
create index on :`User`(`username`);
;
(也與CYPHER MATCH (n) return n;
驗證)
問題查詢:
neo4j-sh (?)$ cypher 2.0 CREATE (i:Id{uuid:2});
CypherExecutionException: Node 82 already exists with label Id and property "uuid"=[2]
事情我都試過
tail -f /var/lib/neo4j/data/log/*.log /var/lib/neo4j/data/graph.db/*.log /var/log/neo4j/*.log
錯誤:什麼都沒有- 記錄重新啓動的Neo4j(
service neo4j-service restart
) - 以上
tail
而重新啓動(僅適用於遠程有趣行:[main] INFO org.neo4j.kernel.AutoConfigurator - WARNING! Physical memory(1017MB) is less than assigned JVM memory(4185MB). Continuing but with available JVM memory set to available physical memory
) - 刪除索引(在/ var/lib中/ Neo4j的/數據/ graph.db /索引/和/var/lib/neo4j/data/graph.db/index.db)並重新啓動
- 恢復上述內容,重新啓動
- 搜索SO
- 搜索neo4j的github問題
到目前爲止沒有什麼幫助。
事情我不會去嘗試
- 這裏的解決方案:neo4j constraint deleted node這是因爲:在生產下降的約束不是一個選項。此外,這是一個幾個版本以前,不同的使用情況:
- 上的
String[]
代替Int
- 東西約束已登錄
- 上的
- 升級到2.0。1在五指交叉這個五月 - 解決問題 - 它時尚不知道,這已經明確解決(我需要知道爲什麼發生這種情況)
其他信息
我有
ulimit -n
和ulimit -Hn
設置爲40Kneo4j-sh (?)$ dbinfo -g Kernel
{ "KernelStartTime": "Fri Feb 21 13:53:57 GMT 2014", "KernelVersion": "Neo4j - Graph Database Kernel (neo4j-kernel), version: 2.0.0", "MBeanQuery": "org.neo4j:instance=kernel#0,name=*", "ReadOnly": false, "StoreCreationDate": "Fri Feb 14 18:43:27 GMT 2014", "StoreDirectory": "/var/lib/neo4j/data/graph.db", "StoreId": "a3351846c194229c", "StoreLogVersion": 21 }
我見過這個:https://github.com/neo4j/neo4j/issues/1069但它似乎解決了。
這是一個VM VirtualBox的一個MacOSX的10.6主機
我是處於虧損狀態,時間對我的第一太問題上。
簡單的答案是「只需擦拭所有東西,然後重新開始」(或者只是重新約束),但這並不是真的可以接受的(如果這種情況發生在生產中呢?)。
任何想法?
可以嘗試用暗號MERGE命令?基本上,它會避免你的例外,因爲MERGE將創建或僅返回現有節點模式 –
'neo4j-sh(?)$ MERGE(i:Id {uuid:2});' 'EntityNotFoundException:具有標識82的節點' –
奇怪!似乎你的分貝已經腐敗。這些命令返回的是什麼,你可以告訴 start n = node(82)return n –