Unsolved QSqlDriver does not support Transactions (but everything seems to be installed)
-
Hi and welcome to devnet,
What version of MySQL is your server ?
-
@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.
-
Same to you !
Did you rebuild the Qt MySQL plugin ?
-
@SGaist
Hm nope i use the standard one directly from Qt. Is this probably a problem? -
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 ?
-
@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. -
Hello all,
if i generate the transaction by myself with QSqlQuery ... it works ... but not with the functions provided by the QSqlDriver. Hmpf
-
How were you using it ?
-
@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)) { ... }
-
So basically if you don't do the check and use it, it works as expected ?
-
@SGaist
Nope ... i tested it a lot and it dont work. -
Sorry, I misunderstood you. So if you write the transaction in the SQL statement of the QSqlQuery it's working properly. Correct this time ?
-
@SGaist
Yes if i write the transaction sql syntax in the QSqlQuery by myself ... it is working correctly. -
That's not the most easy but I'd re-build the MySQL plugin to see what the check does currently.