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. QSqlDriver does not support Transactions (but everything seems to be installed)
Forum Updated to NodeBB v4.3 + New Features

QSqlDriver does not support Transactions (but everything seems to be installed)

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 3 Posters 5.0k 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.
  • VRoninV Offline
    VRoninV Offline
    VRonin
    wrote on last edited by
    #2

    Most likely is due to a restriction in the Qt code that manages the driver. what driver are you using? what are you passing to QSqlDatabase::addDatabase?

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    M 1 Reply Last reply
    0
    • VRoninV VRonin

      Most likely is due to a restriction in the Qt code that manages the driver. what driver are you using? what are you passing to QSqlDatabase::addDatabase?

      M Offline
      M Offline
      MrEinsA
      wrote on last edited by
      #3

      @VRonin

      Thanks for the fast reply, this is my connection code:

          m_dbConnection = QSqlDatabase::addDatabase("QMYSQL");
          m_dbConnection.setHostName(host);
          m_dbConnection.setPort(port);
          if (!m_dbConnection.open(user, password))
          {
              coutFRed("::connect, %s", qPrintable(m_dbConnection.lastError().text()));
              return false;
          }
            coutFGreen("::connect, connection active...");
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Hi and welcome to devnet,

        What version of MySQL is your server ?

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

        M 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          What version of MySQL is your server ?

          M Offline
          M Offline
          MrEinsA
          wrote on last edited by
          #5

          @SGaist
          Happy new year!!!

          I run it with the current XAMPP on my localhost (10.1.26-MariaDB), but even with a database on my server MySQL 5.7.

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

            Same to you !

            Did you rebuild the Qt MySQL plugin ?

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

            M 1 Reply Last reply
            0
            • SGaistS SGaist

              Same to you !

              Did you rebuild the Qt MySQL plugin ?

              M Offline
              M Offline
              MrEinsA
              wrote on last edited by
              #7

              @SGaist
              Hm nope i use the standard one directly from Qt. Is this probably a problem?

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

                Not necessarily. The transaction detection is effective if the client library version used to build the plugin is greater than 3.23.34. Now the question is is, are you sure the server supports it ?

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

                M 1 Reply Last reply
                0
                • SGaistS SGaist

                  Not necessarily. The transaction detection is effective if the client library version used to build the plugin is greater than 3.23.34. Now the question is is, are you sure the server supports it ?

                  M Offline
                  M Offline
                  MrEinsA
                  wrote on last edited by
                  #9

                  @SGaist
                  Thanks for the answer ... yes im sure, i tested it in the MySQL Workbench and its running there. Hm maybe i should reinstall everything again.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MrEinsA
                    wrote on last edited by
                    #10

                    Hello all,

                    if i generate the transaction by myself with QSqlQuery ... it works ... but not with the functions provided by the QSqlDriver. Hmpf

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

                      How were you using it ?

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

                      M 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        How were you using it ?

                        M Offline
                        M Offline
                        MrEinsA
                        wrote on last edited by
                        #12

                        @SGaist
                        Hi, like this:

                           m_dbConnection.setHostName(host);
                            m_dbConnection.setPort(port);
                            if (!m_dbConnection.open(user, password))
                            {
                                return false;
                            }
                        
                            if (!m_dbConnection.driver()->hasFeature(QSqlDriver::Transactions))
                            {
                                ...
                            }
                        
                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #13

                          So basically if you don't do the check and use it, it works as expected ?

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

                          M 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            So basically if you don't do the check and use it, it works as expected ?

                            M Offline
                            M Offline
                            MrEinsA
                            wrote on last edited by
                            #14

                            @SGaist
                            Nope ... i tested it a lot and it dont work.

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

                              Sorry, I misunderstood you. So if you write the transaction in the SQL statement of the QSqlQuery it's working properly. Correct this time ?

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

                              M 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                Sorry, I misunderstood you. So if you write the transaction in the SQL statement of the QSqlQuery it's working properly. Correct this time ?

                                M Offline
                                M Offline
                                MrEinsA
                                wrote on last edited by
                                #16

                                @SGaist
                                Yes if i write the transaction sql syntax in the QSqlQuery by myself ... it is working correctly.

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

                                  That's not the most easy but I'd re-build the MySQL plugin to see what the check does currently.

                                  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