0

Using Neo4j 4.4.11 (community edition), I'm trying to delete a certain type of relationships from my graph with cypher-shell:

MATCH ()-[r:MYRELATIONSHIPLABEL]->() CALL { WITH r DETACH DELETE r } IN TRANSACTIONS OF 10000 ROWS;

But I always end up with this error:

Connection read timed out due to it taking longer than the server-supplied timeout value via configuration hint.

Is it possible to increase the read timeout directly in cypher-shell without changing the server settings? (I did not find anything in the docs.)

Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134

1 Answers1

0

Yes, that is possible by using the following command.

call dbms.setConfigValue('dbms.transaction.timeout','0')

The zero indicates that there should be no timeout. As indicated by Christophe in the comments, this call changes the server setting via cypher shell, so all the applications connecting to Neo4j are affected. There is no way around this other than to change it back to the original setting once you are done.

Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31
  • please note that here you change the server setting which will affect all the applications connecting to neo4j. – Christophe Willemsen Dec 14 '22 at 19:35
  • Thanks! I did not yet know about dynamic configs. They are very handy. However, in my statement, I already split into small-ish transactions (`MATCH ()-[r:MYRELATIONSHIPLABEL]->() CALL { WITH r DETACH DELETE r } IN TRANSACTIONS OF 10000 ROWS;`). So I don't think I run into `dbms.transaction.timeout` ("The maximum time interval of a transaction within which it should be completed."), but into something else. Also, `dbms.transaction.timeout` already has a value of `0s` in my case: https://gist.github.com/Dobiasd/43a1d2fb2c97a9aae960ca5118d0e920 – Tobias Hermann Dec 15 '22 at 07:38