qsql_oci: use OCI_COMMIT_ON_SUCCESS for SELECT without transaction
authorMark Brand <mabrand@mabrand.nl>
Tue, 17 Jul 2012 07:32:20 +0000 (09:32 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 13 Aug 2012 21:16:38 +0000 (23:16 +0200)
Otherwise, the open statement, say in QSqlQueryModel, will prevent
other statements from running.

Task-number: QTBUG-18608
Change-Id: Icdd6817fb981678be6fb70ade21a8123e152dcf6
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
src/sql/drivers/oci/qsql_oci.cpp

index 02eda36..82dc854 100644 (file)
@@ -1962,13 +1962,8 @@ bool QOCIResult::exec()
         return false;
     }
 
-    if (stmtType == OCI_STMT_SELECT) {
-        iters = 0;
-        mode = OCI_DEFAULT;
-    } else {
-        iters = 1;
-        mode = d->transaction ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS;
-    }
+    iters = stmtType == OCI_STMT_SELECT ? 0 : 1;
+    mode = d->transaction ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS;
 
     // bind placeholders
     if (boundValueCount() > 0