QSqlDatabase catch server restart
-
Hello.
I create a connection to the PostgreSQL. If you restart the server, the driver issues the following errors in the terminal:
FATAL: terminating connection due to administrator command
FATAL: terminating connection due to administrator command
FATAL: terminating connection due to administrator command
FATAL: terminating connection due to administrator command
WARN - QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
WARN - QSocketNotifier: Invalid socket 14 and type 'Read', disabling...
WARN - QSocketNotifier: Invalid socket 12 and type 'Read', disabling...
WARN - QSocketNotifier: Invalid socket 15 and type 'Read', disabling...Is it possible to catch these errors ? This is very important because I use the notification mechanism and after the server reboot notification does not work
-
Hi
You can see if it sends anything in
http://doc.qt.io/qt-5/qsqldriver.html#subscribeToNotification
(if driver supports it) -
Hi
You can see if it sends anything in
http://doc.qt.io/qt-5/qsqldriver.html#subscribeToNotification
(if driver supports it) -
@mrjj
I already use the notification mechanism. The problem is that after the server is rebooted, the driver resets the notification subscriptions. Question - how to catch that the subscriptions are dropped@minigo
Yeah, docs mentions that all subs are dropped.
Did you check
http://doc.qt.io/qt-5/qsqldriver.html#subscribedToNotifications
should return zero for .size() -
@minigo
Yeah, docs mentions that all subs are dropped.
Did you check
http://doc.qt.io/qt-5/qsqldriver.html#subscribedToNotifications
should return zero for .size()