-
Notifications
You must be signed in to change notification settings - Fork 165
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
Handle ServiceUnavailableException from the Java Bolt Driver #319
Comments
Related to #301. I think we should try to add this fix to the 2.1.2 release but it would be nice if we can sneak it in to 2.1.1. |
I get this error only when running against the bolt port of an embedded instance (out and back in) using the java driver |
This exception will only be thrown from a neo4j 3.1 + instance btw using Bolt. |
Same issue here, trying to connect to an embedded instance with Bolt and java driver, any hint on how to do that? |
Hi. Having a similar issue: this happens to me only on Java 9, not on Java 8. Any hints on this? |
Thanks for your feedback. The Bolt transport will now translate this into Regarding running embedded and opening a bolt port to the outside: We strongly recommend not doing this. Neo4j-OGM uses the database api to communicate with the embedded instance, too. |
Hi,
As per neo4j/neo4j-java-driver#302, the Java Driver is launching
ServiceUnavailableException
in case the client loses connection with the server (eg. network glitches, server restarts, …). AFAIK the philosophy is that the libs and apps using the driver should catchServiceUnavailableException
.However, I noticed that
neo4j-ogm
does not handleServiceUnavailableException
yet. The only reference to a server disconnection I've found isClientException
being rethrown as aCypherException
:BoltRequest.java
BoltResponse.java
It seems that
CypherException
is too generic. For instance,spring-data-neo4j
handles it this way:So they don't have the information that a
ServiceUnavailableException
conveys, which forspring-data-neo4j
could mean converting it to aRecoverableDataAccessException
so that the connection could be retried (see: spring-projects/spring-data-neo4j#373)In my (maybe naïve) debugging session, I've found that a possible solution could be creating a
org.neo4j.ogm.exception.ServiceCommunicationException
that can be used by the upper layers (eg. spring-data-neo4j). But where should the exception be launched?Well, it seems that both
BoltRequest.java
andBoltResponse.java
don't check for stale sessions:Wouldn't be enough, since the connection is stalled (hence not null) and the failure happens only after the request is executed or the results are fetched.
The text was updated successfully, but these errors were encountered: