Hi all,
I've noticed that QSqlDatabase::transaction() and QSqlDriver::beginTransaction() don't work when using QSQLITE driver.
Using QSqlQuery::exec("BEGIN TRANSACTION") work correctly.
It's a bug?
PS. both QSqlDatabase::transaction() and QSqlDriver::beginTransaction() return true for correct execution
Example code
doesn't workCode:
db.transaction(); // returns true for (int i = 0; i < 1000; ++i) { // INSERT data } db.commit(); // returns true
works correctly.Code:
q.exec("BEGIN TRANSACTION"); for (int i = 0; i < 1000; ++i) { // INSERT data } q.exec("COMMIT");