Unhelpful Neo4j Error Message


Xanatos
Member
Registered: 03.12.12 14:12
Timezone: UTC +1
Posts: 13

Hi I'm trying to execute a simple query like this:

START
x = node(167966)
MATCH
x-[r?:RELATED_CONTENT]->content
WHERE
content.source='crawler'
DELETE
r, content

And I keep getting this weird and extremely unhelpful error message:

TransactionFailureException: Unable to commit transaction

Any ideas what causes this?


Xanatos
Member
Registered: 03.12.12 14:12
Timezone: UTC +1
Posts: 13

Hi I'm trying to execute a simple query like this:

START
x = node(167966)
MATCH
x-[r?:RELATED_CONTENT]->content
WHERE
content.source='crawler'
DELETE
r, content

And I keep getting this weird and extremely unhelpful error message:

TransactionFailureException: Unable to commit transaction

Any ideas what causes this?


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 144

I've seen this before. Neo4j error messages are terrible. I'm guessing that the 'content' node you're trying to delete still has relationships, and you can't delete a node that is still connected to other nodes.

Try this:

START x = node(167966) 
MATCH x-[r?:RELATED_CONTENT]->content 
WHERE content.source='crawler' 
WITH content
MATCH content-[r?]-()
DELETE r, content

That should delete all of the relationships to the content node and the node itself.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 144

I've seen this before. Neo4j error messages are terrible. I'm guessing that the 'content' node you're trying to delete still has relationships, and you can't delete a node that is still connected to other nodes.

Try this:

START x = node(167966) 
MATCH x-[r?:RELATED_CONTENT]->content 
WHERE content.source='crawler' 
WITH content
MATCH content-[r?]-()
DELETE r, content

That should delete all of the relationships to the content node and the node itself.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


Xanatos
Member
Registered: 03.12.12 14:12
Timezone: UTC +1
Posts: 13

Awesome, that worked. Thanks!

They should really make a more specific error message for this like "TransactionFailureException: Unable to commit transaction because deleted node still has relationships."


Xanatos
Member
Registered: 03.12.12 14:12
Timezone: UTC +1
Posts: 13

Awesome, that worked. Thanks!

They should really make a more specific error message for this like "TransactionFailureException: Unable to commit transaction because deleted node still has relationships."