Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-08-2021 02:15 AM
@staticmethod
def _getUser(tx, user_id):
query = (
'MATCH (u:User) '
'WHERE u.user_id = $user_id '
'RETURN u')
return tx.run(query, user_id=user_id)
Here is my transaction function, the whole code is too many pages to post. Was wondering why this is not returning anything in result (e.g. result.single() == None).
I am sending it using session.read_transaction(self._getUser, user_id)
This is something I can't really debug without being a Neo4j driver author.
Solved! Go to Solution.
01-15-2022 04:35 AM
I encountered the same issue in Python, all queries returning empty results, however in my case it was a simple object lifetime issue. The official neo4j driver works fine.
This occurred after updating from version 1.7.6 to 4.x.x
What I did was returning a result within the with
:
driver = GraphDatabase.driver(...)
with driver.session() as session:
return session.run(query)
On exiting the with
, it closes the session, and the results are no longer accessible. Interestingly there is a difference in behaviour of the python driver between old (pre 4) and new versions.
01-08-2021 03:02 AM
Solution is to try a different driver. I'll try py2neo driver.
01-09-2021 01:26 PM
Update your driver if not
Make sure your parameter type fits with the one in your database.
Make sure you are properly using the result function
01-15-2022 04:35 AM
I encountered the same issue in Python, all queries returning empty results, however in my case it was a simple object lifetime issue. The official neo4j driver works fine.
This occurred after updating from version 1.7.6 to 4.x.x
What I did was returning a result within the with
:
driver = GraphDatabase.driver(...)
with driver.session() as session:
return session.run(query)
On exiting the with
, it closes the session, and the results are no longer accessible. Interestingly there is a difference in behaviour of the python driver between old (pre 4) and new versions.
All the sessions of the conference are now available online