The cypher PROFILE keyword asks for a transaction

2019-08-28 15:08发布

问题:

I am trying to profile the following query on the neo4j server console (community edition, version 1.9.2):

PROFILE START ungrouped=node(1) 
CREATE (grouped{__type__:'my.package.Grouped'})<-[:HAS_NEXT]-(ungrouped) 
MATCH (ungrouped)-[:LEAF]->(leaf) 
WITH leaf.`custom-GROUP` as groupValue, grouped, leaf
CREATE UNIQUE (grouped)-[:GROUP]->({__type__:'my.package.Group',groupKey:'GROUP',groupValue:groupValue,groupOrigin:ID(ungrouped)})-[:LEAF]->(leaf) 
RETURN DISTINCT grouped;

When I run the above query, I get the message

==> I need a transaction!

Ok, so I created one with

BEGIN TRANSACTION
==> Transaction started

Afterwards I run the same query again. But unfortunately I get the same message again:

==> I need a transaction!

But there definitely is a transaction. When I type

ROLLBACK

the transaction is successfully rolled back:

==> Transaction rolled back

Am I doing something wrong? Does profiling not work for such kind of a query by design? Or is this simply a bug in neo4j?

标签: neo4j cypher