We have a system consisting of two c++ applications (running as exes) and a plotly dash dashboard in python. It is an offline system (dash running on local host), using an sqlite database (in WAL mode) to store data and to interact between the different components.
Every C++ component has an open database connection that is passed through the respective program and this works fine.
Now my question is how to handle this on the python/dash side, since I do not understand dash enough (I'm not the dash programmer).
- In which place would I allocate the database connection object to pass it around or to make it available from the different callbacks.
- Does dash on local host use multi threading for its callbacks etc where a single database connection in the application would be a problem
- In case of multi threading problems: Would it be a valid solution to open a database connection in every callback (when necessary) and close it explicitly before leaving the callback?