Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE during transaction rollback when custom query fails [DATAGRAPH-997] #1559

spring-projects-issues opened this issue May 18, 2017 · 0 comments
in: core Issues in core support type: bug A general bug


Copy link

Konstantin Lutovich opened DATAGRAPH-997 and commented


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:

Exception in thread "main" java.lang.NullPointerException
at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(
at org.neo4j.SampleMovieApplication.main(

Affects: 4.2.3 (Ingalls SR3)

Reference URL:

Referenced from: commits 2a4df87, 1e39f81

Backported to: 4.2.8 (Ingalls SR8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core Issues in core support type: bug A general bug
None yet

No branches or pull requests

1 participant