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
Qt 6.11 is out! See what's new in the release blog

QSqlDatabase catch server restart

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.1k Views 1 Watching
  • 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      0
      • mrjjM mrjj

        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 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

        mrjjM 1 Reply Last reply
        0
        • M minigo

          @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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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
          0
          • mrjjM mrjj

            @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 last edited by
            #5

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

            1 Reply Last reply
            0

            • Login

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