title: QSqlError("5", "Unable to fetch row", "database is locked")
body: <p>I am getting this error "<code>QSqlError("5", "Unable to fetch row", "database is locked")</code>"</p>
  
  <p>I have done my research and I think the problem arises from the fact that I am executing an <code>INSERT</code> query while the <code>SELECT</code> query is still active, which locks the database. Now I'd imagine people run into this problem often since it is common to write to a database based on the output of a <code>SELECT</code> query, so I wanted to ask what is the best way to solve this? Would I be able to fetch the query (using <code>query.next()</code>) after closing it with <code>query.finish()</code> to unlock the database? Or should I store the result in a temporary container, close the query then iterate over the temporary container?</p>
  
  <p>Thank you very much in advance</p>