Skip to content

Regression: Constraint Validations are no longer translated into DataIntegrityViolationException with neo4j-java-driver >= 4.3.2 #2542

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

Closed
GrahamLea opened this issue May 23, 2022 · 6 comments
Assignees

Comments

@GrahamLea
Copy link

GrahamLea commented May 23, 2022

Scenario

Execute a modifying Neo4j transaction that results in a constraint violation.

Expected behaviour

The repository throws a org.springframework.dao.DataIntegrityViolationException.
(This is what it does with neo4j-java-driver versions < 4.3.2)

Actual Behaviour

The repository throws a org.neo4j.driver.exceptions.ClientException.

Reproduction

  1. Clone https://github.com/GrahamLea/neo4j-bugs
  2. Load in IntelliJ IDEA
  3. Run TestNodeTest.raises DataIntegrityViolationException on constraint violation
  4. It will fail
  5. In pom.xml, change neo4j.driver.version back to 4.3.1
  6. Run test again and it will pass

Comments

It's possible there's a regression in neo4j-java-driver that has caused this to happen.
But the expected result DataIntegrityViolationException is part of this project, so I didn't feel I could submit the issue there.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 23, 2022
@michael-simons michael-simons self-assigned this May 23, 2022
@michael-simons
Copy link
Collaborator

Puh, this is on a very old SDN version that we actually don't support anymore. There's actually little I can do, VMWare most likely won't do any release of the old 5.x branches anymore.

However, I think this can be fixed in the underlying OGM.

OGM 3.2.34 will go out this morning, please try it out and close the issue if this fixes things for you.

michael-simons added a commit to neo4j/neo4j-ogm that referenced this issue May 23, 2022
This cataches and translations `ClientException` into the generic
Neo4j-OGM `CypherException` while consuming the results too.

It should fix
spring-projects/spring-data-neo4j#2542 and is
most likely necessary to encounter for the changes in
neo4j/neo4j-java-driver#897.
@michael-simons michael-simons added blocked: awaiting feedback and removed status: waiting-for-triage An issue we've not yet triaged labels May 23, 2022
@michael-simons michael-simons added this to the 5.3.10 (Neumann SR10) milestone May 23, 2022
@GrahamLea
Copy link
Author

Thanks for jumping on that so quickly.
Should I expect that 3.2.34 release to pop up in Maven Central (it hasn't yet), or do I need to pull it from somewhere else?

@michael-simons
Copy link
Collaborator

That's kinda odd, because our CI says the job has finished correctly and normally, central isn't that slow.
In short: Yes, it should have been on central.

@michael-simons
Copy link
Collaborator

Ok, it was a problem of the operator (me, in this case) which is solved now.

https://repo1.maven.org/maven2/org/neo4j/neo4j-ogm-core/3.2.34/

Thanks for your ping, @GrahamLea

@GrahamLea
Copy link
Author

Yep, 3.2.34 has fixed it. Thanks. Amazing service! 😉👏

@michael-simons
Copy link
Collaborator

Thanks a lot for your feedback <3

michael-simons added a commit to neo4j/neo4j-ogm that referenced this issue May 30, 2022
This cataches and translations `ClientException` into the generic
Neo4j-OGM `CypherException` while consuming the results too.

It should fix
spring-projects/spring-data-neo4j#2542 and is
most likely necessary to encounter for the changes in
neo4j/neo4j-java-driver#897.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants