Running version 4.6.4 on Windows 7 using the Windows installer, using the mysql database version running apache/php/mysql (xampp) on localhost (rather than a remote server). My computer (desktop pc) hibernates if unused for 4+ hours using the Windows powersave option. If I leave KMM open overnight, it always crashes when I try to use it in the morning. Once the program restarts, it's fine and runs normally. Reproducible: Always Steps to Reproduce: 1. Use the program, leave it open overnight 2. When I return in the next morning, click on the program. Screen is visible and my information is there, but program is unresponsive. 3. After a few minutes, I get an error message saying the program must restart. Actual Results: I get the following error message: Error in function void __thiscall MyMoneyStorageSql::close(bool) : starting commit unit Driver = QMYSQL, Host = localhost, User = root, Database = KMyMoney Driver Error: QMYSQL: Unable to begin transaction Database Error No 2006: MySQL server has gone away Text: MySQL server has gone away QMYSQL: Unable to begin transaction Error type 2 Executed: Query error No -1: Driver not loaded Driver not loaded Error type 1 void __thiscall MyMoneyStorageSql::close(bool) in file e:\r\build\extragear\kmymoney-4.6.1-20110918\work\kmymoney-4.6.4\kmymoney\mymoney\storage\mymoneystoragesql.cpp line 870 Expected Results: Allow me to use the program without crashing. I run a fairly basic version of apache/mysql/php using the xampp (php vers 5.4.27, mysql 5.0.10.
To the devs, looking at MyMoneyStorageSql::close it seems that the logoff transaction is created only when QSqlDatabase::isOpen() returns true, so it seems that QSqlDatabase::isOpen() might return true even in case the DB went away, should we catch and ignore transactions in this place?
I'd say it should try to restore the database connection if it finds such a case. If unable to do so, then yes, it should quit without trying to enter any transaction.
This can easily be reproduced with the following steps: 1. start kmymoney 2. open a mysql database 3. stop mysql server
Git commit a0433f9cb0f4657ff195f3de37a7d4c1f385b444 by Ralf Habacker. Committed on 29/06/2017 at 19:58. Pushed by habacker into branch '4.8'. Fix 'Crashes on return from hibernation overnight (edit)'. Enabled mysql reconnect option. FIXED-IN:4.8.1 M +1 -0 kmymoney/mymoney/storage/mymoneystoragesql.cpp https://commits.kde.org/kmymoney/a0433f9cb0f4657ff195f3de37a7d4c1f385b444