I'm facing an issue where Neo4jTransactionManager fails to rollback transaction after runtime exception in a custom Cypher query. Attached github repository contains a project to reproduce the problem.
It contains a repository which extends GraphRepository and adds a single method with a custom query MATCH (m:Movie) WHERE m.title = '' RETURN m AS movie, 10/0 AS other. This query obviously generates a "division by zero" runtime exception. However I can also see NPE stacktrace. It seems to occur because Neo4jTransactionManager tries to rollback transaction that has already been rolled back by OGM code in BoltResponse#next().
Division by zero in this example is artificial, in reality queries can fail in many different ways at runtime (deadlocks, type errors, etc.).
Konstantin Lutovich opened DATAGRAPH-997 and commented
Hello,
I'm facing an issue where Neo4jTransactionManager fails to rollback transaction after runtime exception in a custom Cypher query. Attached github repository contains a project to reproduce the problem.
It contains a repository which extends GraphRepository and adds a single method with a custom query MATCH (m:Movie) WHERE m.title = '' RETURN m AS movie, 10/0 AS other. This query obviously generates a "division by zero" runtime exception. However I can also see NPE stacktrace. It seems to occur because Neo4jTransactionManager tries to rollback transaction that has already been rolled back by OGM code in BoltResponse#next().
Division by zero in this example is artificial, in reality queries can fail in many different ways at runtime (deadlocks, type errors, etc.).
Seen stacktrace:
Affects: 4.2.3 (Ingalls SR3)
Reference URL: https://github.com/lutovich/sdn-test
Referenced from: commits 2a4df87, 1e39f81
Backported to: 4.2.8 (Ingalls SR8)
The text was updated successfully, but these errors were encountered: