Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using a db three times at the same time
Forum Updated to NodeBB v4.3 + New Features

Using a db three times at the same time

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 4.9k Views 1 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.
  • K Offline
    K Offline
    kitten
    wrote on last edited by
    #1

    hi to every one
    i have a program using qsqlite plugin
    i want to run it three times at the same time
    and these programs should use one db name mydb.db,i want to know if a query happened at the same time does it have any problem?

    www.kitten.mihanblog.com

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #2

      bq. i want to run it three times at the same time

      Could you please elaborate the issue ?


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kitten
        wrote on last edited by
        #3

        if my programs runs three query at the same time on my data base , does it have a problem or no?

        www.kitten.mihanblog.com

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rahul Das
          wrote on last edited by
          #4

          If you are trying to run 1 program and three queries, there are no problems!

          But if you are trying to run more than one program upon a single db file, there could be some problem regarding read/write locks!


          Declaration of (Platform) independence.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kitten
            wrote on last edited by
            #5

            how can i solve it?

            www.kitten.mihanblog.com

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #6

              You may use "shared-cache mode":http://www.sqlite.org/sharedcache.html.


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kitten
                wrote on last edited by
                #7

                is it enough i use this code?
                @db.setConnectOptions("QSQLITE_ENABLE_SHARED_CACHE=1;");@

                www.kitten.mihanblog.com

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Rahul Das
                  wrote on last edited by
                  #8

                  Yes, that is correct. :)
                  Remember, as per "doc":http://doc.qt.nokia.com/latest/qsqldatabase.html#setConnectOptions

                  bq. This must be done before the connection is opened or it has no effect


                  Declaration of (Platform) independence.

                  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