[odb-users] using ODB for interactive access

Panayiotis Georgiou ps.georgiou at gmail.com
Tue Nov 7 07:28:30 EST 2017


Hello,

We are developing a GUI application with Qt which uses an sqlite database
mapped with ODB. The application is developed using Qt's Model/View
Delegate approach, where the View corresponds to the forms/dialogs
presented to the user and the Model's handle the data presented by the
views.

In order to avoid having multiple copies (possibly out-of-sync) of the data
in memory the models do not hold any data but directly operate on the
database. For example when a view requests a particular record, then the
model will load it and pass it to the view. Similarly, if the view edits a
record, then the model will directly apply the changes to the database and
then trigger a refresh of the view.

Although this approach keeps the data presented by the view always in sync
with the database, this approach seems very slow for interactive use. For
example. clicking on a cell on the table-view to edit it might take maybe
1-2 seconds to respond.

So my question is: How can this be made faster for interactive use? Is
there a way of keeping the database open in main-memory for faster access
(our database is relatively small)? Any suggestions will be appreciated.

Thanks for your help,
Panayiotis.


More information about the odb-users mailing list