【发布时间】:2016-05-24 10:50:34
【问题描述】:
想知道我的事务是否需要配置以便它不是只读的......
在过程中创建节点时出现错误。错误是
原因:org.neo4j.graphdb.security.AuthorizationViolationException:READ 事务不允许写入操作。
调用该过程的测试是 -
@Test
public void testLoad() throws Exception {
GraphDatabaseService db = new TestGraphDatabaseFactory().newImpermanentDatabase();
((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(Procedures.class)
.register(LiveServiceLoad.class);
Result res = db.execute("CALL load.hello()");
}
导致错误的过程 -
@Procedure
public Stream<Output> loadTimeTable() {
try ( Transaction tx = db.beginTx() )
{
Node liveServiceNode = db.createNode(Label.label("LiveService"));
【问题讨论】:
标签: neo4j transactions procedures