抱歉打扰了-我应该像现在一样测试一下。因此,对于所有想知道的人来说:似乎您甚至需要序列化读访问--或者确保不尝试对相同属性进行并发读取。
我测试的是:
- 使用BatchInserter创建100个节点,每个节点具有一个字符串属性
- 写2线程试图从无休止循环中的节点中获取属性
结果是:
- 当两个线程从不同的节点读取属性时,一切都很好。
- 当线程从同一节点读取时,将引发以下异常
线程" thread -2“中的异常( org.neo4j.kernel.impl.store.record.PropertyRecord.next(PropertyRecord.java:187) at org.neo4j.kernel.impl.store.record.PropertyRecord.next(PropertyRecord.java:41) at org.neo4j.kernel.impl.transaction.state.PropertyTraverser.getPropertyChain(PropertyTraverser.java:66) at org.neo4j.unsafe.batchinsert.internal.BatchInserterImpl.getPropertyChain(BatchInserterImpl.java:1000) at org.neo4j.unsafe)。batchinsert.internal.BatchInserterImpl.getNodeProperties(BatchInserterImpl.java:900) at org.hucompute.wikidragon.core.test.BatchInserterTest$ReadThread.run(BatchInserterTest.java:56)
谨致问候,
吕迪格