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

QSqlQuery locking problem with QSQLITE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.5.2
    • SQL Support, sqlite
    • None
    • Linux/X11

    Description

      I have an in-memory sqlite database which is accessed from several threads.

      Each thread has its own database connection and the database is initialized with   db.setDatabaseName("file:base?mode=memory");
      db.setConnectOptions("QSQLITE_OPEN_URI;QSQLITE_ENABLE_SHARED_CACHE;QSQLITE_BUSY_TIMEOUT=10000000");

      In addition I set the locking_mode to NORMAL.

      According to all documentation I found these settings should enable the threads to access the database (nearly) without any driver errors.

      But it appears that QSqlQuery sets a lock to the database whichremains until the query is cleared or deleted. This should not happen.

      To reproduce this problem I've attached a little program which creates a table "woeld" with one entry. This entry is copied to a second one in a thread.

      To show the effect I send the main thread to sleep for some time and then call query.cler().  In the thread  I try the copy operation until it works. 

      Attachments

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

        Activity

          People

            chehrlic Christian Ehrlicher
            cyril Harald Prasser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes