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 workQt Code:
db.transaction(); // returns true
for (int i = 0; i < 1000; ++i)
{
// INSERT data
}
db.commit(); // returns trueTo copy to clipboard, switch view to plain text mode
works correctly.Qt Code:
q.exec("BEGIN TRANSACTION");
for (int i = 0; i < 1000; ++i)
{
// INSERT data
}
q.exec("COMMIT");To copy to clipboard, switch view to plain text mode




 
					
					 
							
								
 
    
    
       
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   SQLITE Transactions
 SQLITE Transactions
		 
				
				
				
					 Reply With Quote
  Reply With Quote
Bookmarks