错误解释:“此事务 (txId=yyyyy) 开始后数据库约束已更改 (txId=xxxxx),但尚不支持”
以下错误,通过 bin/neo4j-shell
Database constraints have changed (txId=84) after this transaction (txId=81) started, which is not yet supported. Please retry your transaction to ensure all constraints are executed.
或记录在 log/debug.log
(3.x) 或 graph.db/messages.log
(2.3.x) 中
2016-10-18 16:40:43.595+0000 ERROR [o.n.s.r.t.TransactionFacade]: Failed to commit transaction. java.lang.RuntimeException: org.neo4j.kernel.api.exceptions.TransactionFailureException: Database constraints have changed (txId=81) after this transaction (txId=84) started, which is not yet supported. Please retry your transaction to ensure all constraints are executed. at org.neo4j.server.rest.transactional.TransitionalTxManagementKernelTransaction.commit(TransitionalTxManagementKernelTransaction.java:87) ~[neo4j-server-2.2.8.jar:2.2.8] at org.neo4j.server.rest.transactional.TransactionHandle.closeContextAndCollectErrors(TransactionHandle.java:278) [neo4j-server-2.2.8.jar:2.2.8]
可以通过以下场景解释
txID | 日期/时间 | Cypher 语句 |
---|---|---|
81 |
2012年10月19日 09:00 |
开始 |
84 |
2012年10月19日 09:01 |
开始 |
84 |
2012年10月19日 09:02 |
create constraint on (n:Person) assert n.user_id is unique; |
84 |
2012年10月19日 09:03 |
提交 |
81 |
2012年10月19日 09:04 |
create (n:Person {user_id:1234}) |
81 |
2012年10月19日 09:05 |
提交 |
异常在 2012年10月19日 09:05 由 txID 81 的 Cypher 语句抛出,原因是该语句尝试创建一个适用于新提交约束的节点,并且该事务被回滚。正确的补救措施是重新提交失败的事务。
此页面有帮助吗?