-
Notifications
You must be signed in to change notification settings - Fork 150
driver.onCompleted not executing; driver.onError not executing too. #234
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
Comments
Hello @Jabher, Thanks for reporting this problem. I can reproduce the described behaviour. When driver is used, callbacks seem to be invoked properly:
Maybe you could use smth similar as a workaround? |
Hmm, this sounds like a sound workaround. Maybe it's even better - it's also checking that requests are performing as expected. However, I'd probably recommend to at least re-think the names of callback hooks :) |
BTW, awesome update, I have some performance benchmark in my lib - looks like querying boosted up 3x times - from 250-300 query requests (synthetic env) per second up to 700-900. |
Maybe you can use code similar to this: const {v1: neo4j} = require('neo4j-driver');
const driver = neo4j.driver(...);
const session = driver.session();
session.run('RETURN 1').then(() => {
// proceed with application startup
}).catch(error => {
// fail application startup
}) if request/query verification at startup is desired? Then It is great to hear about the performance improvement :) |
Already did that: Jabher/agregate@6780a44 About performance - I've updated both driver and db (3.0.x -> 3.1.4), so I'm not sure about whom to blame, but still it's working good. |
request/query verification is desired, as long as I really, really, really prefer to raise an wrong credentials exception during the connection - before server hot-swap - instead of catching an error on first user request :) |
Hi @lutovich , I am facing the same problem, can you please help me to understand how to solve this in a browser context? What I am doing right now follows what I have found on the dev docs: I am a Neo4J newbie, so thanks very much for your help! |
You could simply skip the var driver = neo4j.driver("bolt://localhost:7474", neo4j.auth.basic("neo4j", "neo4j"));
// use driver to create sessions here |
@lutovich I get your suggestion, which simply implies to just ignore the usage examples code... but what I don't get is what am I missing? I am doing everything according to the example usage from here: https://github.com/neo4j/neo4j-javascript-driver |
@simonegabbriellini I think it's a bug. Driver does not verify connectivity on creation and |
Hi @lutovich , do you know if this was fixed in 1.5.0-alpha01? |
Hi @shanelacey, I do not think this problem has been fixed. Could you please use |
Hey @lutovich, Thanks for getting back to me! Thats ok I just wanted to check. And yeah I'm using that for now. Looking forward to it, and thanks again for the update. |
Signed-off-by: Dmitry Ponyatov <[email protected]>
So, I've started using this driver after a few months of not using, and everything was crashing - it looked like driver is not instantating.
After some investigations I've discovered that my app was waiting for driver.onCompleted to execute, but it never executed.
However, if I would remove line of waiting driver.onCompleted to run, everything starts to work fine.
Same for driver.onError. I cannot detect whether credentials are bad or I can perform the requests properly.
IDK why this is happening as I've installed older (1.1.0 version) which was working fine with this API. Also I've used neo4j 3.0.x (cannot definitely recall the exact version) and then upgraded to 3.1.4, thinking that it can be newer driver-older db issue, still did not help.
The text was updated successfully, but these errors were encountered: