nosql-tests icon indicating copy to clipboard operation
nosql-tests copied to clipboard

neojs 4.2

Open haralambop opened this issue 3 years ago • 1 comments

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' }

haralambop avatar Mar 10 '21 09:03 haralambop

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.

sduquemesa avatar Apr 07 '21 18:04 sduquemesa