There is a sqlite database. At the moment, connections to the database occur only when necessary, i.e. it took to get the data - connect, sample, disconnect. Accordingly, if there are several different types of data on the form, then for each of them these 3 operations are performed.
For example: with the form we get information about the cat. On the form of combobox'ы with the choice of breed, coloring, nursery. To fill each combobox , connect, fetch, disconnect is called.
Is it right to do so? Or is it better when you start the application to connect to the database and keep the connection until the application is closed?