There's your problem right there. Neo4j is dropping the connection in the middle of whatever work you're doing.
The next thing you should do is go check your server logs (neo4j.log and debug.log) and look for the reason why. In particular look for exception stacktraces, and server restarts. What to do next depends on why the server is doing this.