Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-03-2019 03:07 AM
Is there a standard way to trigger driver.close() upon application exit?
Is there any way to provide a message upon successful completion of driver.close()?
08-13-2019 07:52 PM
Is this a node.js application or a webpage using the javascript driver?
driver.close();
alert('Driver successfully closed!');
would work to let you know it was successful, if driver.close() has an error then the alert line would not run (or use a console.log or some custom function)
08-15-2019 06:22 PM
Jacob,
Thanks for your guidance here.
This will be a front end webpage application using the javascript driver. Users will utilize the app periodically during their work day. I'm thinking I want to close the driver when the user closes the tab or browser. I suspect I'll need to trigger this driver close on the onbeforeunload event, but am asking if there is common standard recommendation for which event trigger to use to close the driver?
Also, if the driver.close() operates asynchronously, wouldn't the "Driver successfully closed" always be displayed even if the .close() function fails?
Thanks again,
Dennis
08-25-2019 05:33 PM
Not postive, but I think the driver.close()
is synchronous.
If its not, then you would do driver.close().then(function() { alert('Driver sucessfully closed!'); });
I've got no guidance on a comment event to use, a lot of my front end development is with React.js so it works a little different.
All the sessions of the conference are now available online