Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137177

QSqlDatabase: connection 'x' is still in use, all queries will cease to work.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.8.3
    • SQL Support
    • None
    • Windows

      I couldn't remove database connection, even I don't use it.

      #include <QCoreApplication>
      #include <QSqlDatabase>int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);    
            QSqlDatabase db;
          db = QSqlDatabase::addDatabase("QSQLITE", "x");   
            qInfo() << QSqlDatabase::connectionNames();
          qInfo() << db;
          QSqlDatabase::removeDatabase("x");
          qInfo() << QSqlDatabase::connectionNames();    
            return a.exec();
      }
        

      the output:

      QList("x")
      QSqlDatabase(driver="QSQLITE", database="", host="", port=-1, user="", open=false)
      qt.sql.qsqldatabase: QSqlDatabasePrivate::removeDatabase: connection 'x' is still in use, all queries will cease to work.
      QList()

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            chehrlic Christian Ehrlicher
            fragrans LL L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes