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. QSqlDatabase catch server restart
Forum Update on Monday, May 27th 2025

QSqlDatabase catch server restart

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.0k Views
  • 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.
  • M Offline
    M Offline
    minigo
    wrote on 26 Feb 2018, 10:54 last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 26 Feb 2018, 15:28 last edited by
      #2

      Hi
      You can see if it sends anything in
      http://doc.qt.io/qt-5/qsqldriver.html#subscribeToNotification
      (if driver supports it)

      M 1 Reply Last reply 26 Feb 2018, 15:56
      0
      • M mrjj
        26 Feb 2018, 15:28

        Hi
        You can see if it sends anything in
        http://doc.qt.io/qt-5/qsqldriver.html#subscribeToNotification
        (if driver supports it)

        M Offline
        M Offline
        minigo
        wrote on 26 Feb 2018, 15:56 last edited by
        #3

        @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

        M 1 Reply Last reply 26 Feb 2018, 15:58
        0
        • M minigo
          26 Feb 2018, 15:56

          @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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 26 Feb 2018, 15:58 last edited by
          #4

          @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()

          M 1 Reply Last reply 26 Feb 2018, 16:07
          0
          • M mrjj
            26 Feb 2018, 15:58

            @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()

            M Offline
            M Offline
            minigo
            wrote on 26 Feb 2018, 16:07 last edited by
            #5

            @mrjj
            I use Qt 4.8.7. And this is in work for me (((

            1 Reply Last reply
            0

            1/5

            26 Feb 2018, 10:54

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved