You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise at the end of program execution sqlite database remains in use by Julia REPL.
And according to the doc: "The SQLite.DB will be automatically closed/shutdown when it goes out of scope (i.e. the end of the Julia session, end of a function call wherein it was created, etc" - turns out not true!
Link to JuliaLang discussion of the problem: https://discourse.julialang.org/t/sqlite-database-remains-in-use-by-julia-repl/77194
The text was updated successfully, but these errors were encountered:
Hi @MarieJC, thanks for opening an issue! Yeah, this is somewhat a general Julia "destructor" problem as we're relying on the finalizer functionality in Julia, which allows you to register a function that runs when an object is garbage collected. But the problem is, as you noted, it's not well-defined when objects actually get garbage-collected!
Do note that you can always call close(db) or more generally DBInterface.close!(db) to force a database connection to be closed, which we should probably highlight in the docs as the proper way to manage the lifetime resource of your sqlite database connection.
Thank you for your response! Yes, DBInterface.close!(db) works. But in my particular exercise the code operating on a db isspread between diff functions - so it is tricky to close the db at the very end. This is not a priority though!!! We were just testing out similar functionality in several languages, including Julia.
Otherwise at the end of program execution sqlite database remains in use by Julia REPL.
And according to the doc: "The SQLite.DB will be automatically closed/shutdown when it goes out of scope (i.e. the end of the Julia session, end of a function call wherein it was created, etc" - turns out not true!
Link to JuliaLang discussion of the problem:
https://discourse.julialang.org/t/sqlite-database-remains-in-use-by-julia-repl/77194
The text was updated successfully, but these errors were encountered: