You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using BoltSession and found that its run() method just posts two messages, RUN and PULL-ALL, to its connection message queue, not exactly functioning as your document says:
Run a Cypher statement within an auto-commit transaction.
This is really misleading since I have a long query which may not finish before my script quits. It's better to revise your document and recommend other users to use the following practice:
withsession.begin_transaction():
tx.run("query")
Thanks!
Yao
The text was updated successfully, but these errors were encountered:
Sorry I may have had some misunderstanding towards the term "auto-commit". It just states that there will be an automatically created transaction for the query involved and it will commit automatically too. It's not guaranteed that query will be executed immediately, is it?
When you use session.run, two messages run and pull-all will be sent to the server. The moment the server receives these two messages, the server will automatically creates a transaction and run the cypher statement inside this transaction.
It is true that session.run will not ensure that your transaction is finished when run returns, while if you consume all your session run result or close your session, then it will be guaranteed to have your transaction finished. And it is highly recommended to always consume results and close sessions. You could also find more docs here
Hi neo4j-python-driver developers,
I was using
BoltSession
and found that itsrun()
method just posts two messages,RUN
andPULL-ALL
, to its connection message queue, not exactly functioning as your document says:This is really misleading since I have a long query which may not finish before my script quits. It's better to revise your document and recommend other users to use the following practice:
Thanks!
Yao
The text was updated successfully, but these errors were encountered: