Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. SQLite database is locked
Forum Updated to NodeBB v4.3 + New Features

SQLite database is locked

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 2.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NickVN Offline
    NickVN Offline
    NickV
    wrote on last edited by
    #1

    Hi.
    I am facing the following problem: i've created a multithreaded app (qtconcurrent) and the sqlite sometimes informes me that database is locked when i am trying to update or insert. I figured out that this is happens because sqlite can not update, insert or delete when another select is in progress. Is there a way to solve this problem? Another question is if i can use postgres to solve problem and not sqlite? I would be really gratefull if anyone has an answer in my problem because i've tried a lot of thinks but nothing worked. Thanks in advance!

    the_T 1 Reply Last reply
    0
    • NickVN NickV

      Hi.
      I am facing the following problem: i've created a multithreaded app (qtconcurrent) and the sqlite sometimes informes me that database is locked when i am trying to update or insert. I figured out that this is happens because sqlite can not update, insert or delete when another select is in progress. Is there a way to solve this problem? Another question is if i can use postgres to solve problem and not sqlite? I would be really gratefull if anyone has an answer in my problem because i've tried a lot of thinks but nothing worked. Thanks in advance!

      the_T Offline
      the_T Offline
      the_
      wrote on last edited by
      #2

      @NickV
      http://stackoverflow.com/questions/9110212/does-select-in-sqlite3-lock-the-database seems to be related to your problem.

      also http://www.sqlite.org/wal.html may be relevant.

      -- No support in PM --

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Are you using the same connection for each of your thread ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • NickVN Offline
          NickVN Offline
          NickV
          wrote on last edited by
          #4

          Hi.
          No i am creating new connection everytime qtconcurrent call my function. The creation takes place inside the function.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            How are you generating the connection name ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved