]> Some of my projects - localmylist.git/commit
Add active connection checking.
authorAPTX <marek321@gmail.com>
Wed, 18 Sep 2013 18:16:36 +0000 (20:16 +0200)
committerAPTX <marek321@gmail.com>
Wed, 18 Sep 2013 18:16:36 +0000 (20:16 +0200)
commit7b2539d95578eb651566bd8ea5c5ec959855f2c9
tree0f60d0b65b32ac396ce9608c608f85407405044a
parentc2ab00d2ab2bf59d57f1069f920fc8fba09cc195
Add active connection checking.

QtSQL (pg driver) does not send any notification that the connection
to the database has terminated. LML tries to reconnect if a query
fails with a connection error. That check is not sufficient for the
objects that wait for DB notifications. This solution checks if the
connection is still alive by executing a simple query every minute.
If the query fails on a connection error the reconnect mechanism
triggers as before. A new reconnected() signal is emitted when a
reconnect occurs. The active connection checking is only done in
the main thread. Request-/Rename-handler listen for the new signal.
localmylist/database.cpp
localmylist/database.h
localmylist/mylist.cpp
localmylist/renamehandler.cpp
localmylist/requesthandler.cpp