jtdavidson
18th July 2010, 04:59
I have a QSqlTableModel.submitAll() that submits hundreds of rows to a database at once. All, some or none of the rows maybe be accepted by the database, due to the database's rules governing the uniqueness of the rows of data.
The next line of my code then queries the database, to see what was accepted and report the success or failure back to the user.
The trouble is, the database seems to be still processing the submitAll() when the query is made, and often the query returns an incomplete or empty list of changes when indeed hundreds of rows have been added to the table.
How do I make the execution of the query wait for submitAll() to finish? Or, how else might I think about this function? Obviously I could just add a fixed delay, but I want to go about this the right way.
thanks in advance
John
The next line of my code then queries the database, to see what was accepted and report the success or failure back to the user.
The trouble is, the database seems to be still processing the submitAll() when the query is made, and often the query returns an incomplete or empty list of changes when indeed hundreds of rows have been added to the table.
How do I make the execution of the query wait for submitAll() to finish? Or, how else might I think about this function? Obviously I could just add a fixed delay, but I want to go about this the right way.
thanks in advance
John