question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a close method?

See original GitHub issue

I’m using your great library and it seems there is no close method.

I’m developing an app using multiple databases (I mean multiple instances of NEDB object). Actually I’m wondering how you manage all the instances with no explicit call to close.

Thanks in advance

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 3, 2015

Not coupled via shared db object instances, for God’s sake. If I setUp a database content, it does not mean I pass the db instance to the tested code. Tested code loads database on its own (of course). And it means that I of course need close method to know setUp is finished and test can run (or, nedb should keep some internal cache and reuse the db when loaded again with the same file; but that us imo a level harder then being able to close).

Never mind, if you do not want to add close, don’t, I use node-sqlite instead since it can close therefore it is nicely usable in tests.

Robert Hurst notifications@github.comnapísal/a:

@herbyYoursetupandteardownfunctionsarecoupledtoyourtests.Otherwisetherewouldn’tbeanypointtothem.ReplytothisemaildirectlyorviewitonGitHub.

0reactions
olexandrkardashcommented, Sep 23, 2016

@ghost, I faced similar issue, my tested function was updating database, than I wanted to check it in test, but there was still old information. When I opened db file in file system, it was updated, my function was working correctly, but tests weren’t. Than I tried to do db.loadDatabase(); before checking in tests, it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reader close() method in Java with Examples - GeeksforGeeks
The close() method of Reader Class in Java is used to close the stream and release the resources that were busy in the...
Read more >
Java Scanner close() Method - Javatpoint
The close () is a method of Java Scanner class which is used to closes this scanner. Syntax. Following is the declaration of...
Read more >
What is the writer.close() method in Java? - Educative.io
The close () or writer.close() method is used to close the writer. close() flushes and then closes the stream. Once the stream has...
Read more >
Java.util.Scanner.close() Method - Tutorialspoint
The java.util.Scanner.close() method closes this scanner.If this scanner has not yet been closed then if its underlying readable also implements the ...
Read more >
Python File close() Method - W3Schools
The close() method closes an open file. You should always close your files, in some cases, due to buffering, changes made to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found