No. Lock on read is general a bad thing with a view that might sit open forever.
QSqlTableModel does not explicitly create a transaction itself.And what about transactions! Does it support?
The model inserts/updates/delete will be part of a database transaction if you create one with QSqlDatabase::transaction() on the database connection. You then call QSqlDatabase::commit() or rollback() as required. This mechanism would work best with OnManualSubmit where you start the transaction, call QSqlTableModel::submitAll(), and commit() or rollback() based on the success of submitAll(). Read the note on SqlTableModel::submitAll() about failures.





Reply With Quote
Bookmarks