Skip to content
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

neojs 4.2 #30

Open
haralambop opened this issue Mar 10, 2021 · 1 comment
Open

neojs 4.2 #30

haralambop opened this issue Mar 10, 2021 · 1 comment

Comments

@haralambop
Copy link

I am trying to run against the neo4j version 4.2 but I have problems with the transaction handing

node benchmark.js neo4j -a 127.0.0.1 -t 'warmup'

i am getting

INFO using server address 127.0.0.1
INFO start
INFO step 1/2 done
Neo4jError: Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.

at captureStacktrace (/root/nosql-tests/node_modules/neo4j-driver/lib/result.js:281:15)
at new Result (/root/nosql-tests/node_modules/neo4j-driver/lib/result.js:68:19)
at Session._run (/root/nosql-tests/node_modules/neo4j-driver/lib/session.js:174:14)
at Session.run (/root/nosql-tests/node_modules/neo4j-driver/lib/session.js:135:19)
at Object.getDocument (/root/nosql-tests/neo4j/description.js:78:19)
at /root/nosql-tests/neo4j/description.js:43:28
at Object.getCollection (/root/nosql-tests/neo4j/description.js:62:5)
at /root/nosql-tests/neo4j/description.js:35:24
at processTicksAndRejections (node:internal/process/task_queues:94:5) {

code: 'N/A'
}

@sduquemesa
Copy link

The problem is that queries are run on a session that has not concluded the previous transaction. Sessions also need to be closed after every transaction and this is not handled by the sessionManager.

This is solved by handling the concurrent requests using async, and closing each session after query has been executed.

I have implemented this in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants