Wolfgang-Schuetzelhofer / jcypher

Java access to Neo4J graph databases at multiple levels of abstraction
Apache License 2.0
86 stars 15 forks source link

org.neo4j.driver.v1.exceptions.ClientException: You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session. #55

Open Zmey2701 opened 5 years ago

Zmey2701 commented 5 years ago

Hi @Wolfgang-Schuetzelhofer !

I get the following error while running IDBAccess.execute(JcQuery) : "org.neo4j.driver.v1.exceptions.ClientException: You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session."` Library version 4.2.0 .

When is it gonna be fixed?

Wolfgang-Schuetzelhofer commented 5 years ago

Hi, this error was never reported before, and I cannot reproduce it. If you want, you can send me your code, I will have a look at it to determine the problem. What Neo4j version are you using.

Best regards, Wolfgang

Zmey2701 commented 5 years ago

Sorry, can't share the code with you.

But this happens in case you have an app that accesses the Neo4j instance via Bolt and making concurrent access to it. As a result, you will have to create again and again IDBAccess instance and close it. In the other case connections will remain stale and not close.z But creating IDBAccess each time means creating a new thread pool, open a transaction, it and end it.

What is the way to handle multiple simultaneous connections properly?