Hi,

how can i test if a TRANSACTION is ok?

I try this:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::database();
  2. QSqlQuery q(db);
  3. qDebug() << db.driver()->hasFeature(QSqlDriver::Transactions); //true
To copy to clipboard, switch view to plain text mode 
so SQLite aided transactions

But the COMMIT for a TRANSACTION is always TRUE. Here a example:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::database();
  2. db.transaction();
  3.  
  4. qDebug() << q.exec("SELECT;"); //false
  5.  
  6. q.clear();
  7. if(!db.commit()){
  8. db.rollback();
  9. }
To copy to clipboard, switch view to plain text mode 
The COMMIT is TRUE and i try this:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::database();
  2. QSqlQuery q(db);
  3. qDebug() << db.driver()->beginTransaction(); //true
  4. qDebug() << q.exec("SELECT;"); //false
  5. qDebug() << db.driver()->commitTransaction();//true
To copy to clipboard, switch view to plain text mode 
and
Qt Code:
  1. qDebug() << q.exec("BEGIN TRANSACTION"); //true
  2. qDebug() << q.exec("SELECT;"); //false
  3. qDebug() << q.exec("COMMIT");//true
To copy to clipboard, switch view to plain text mode 
The ROLLBACK works fine, but i cant verifying the COMMIT respectively the TRANSACTION!