Menu

#517 FB3 + TZConnection.Ping / PingServer with network down

8.0-Beta
open
nobody
Bug Report
2021-08-27
2021-05-25
sundoctor
No

I notice Firebird 3 connection problem.

TZConnection.Ping
TZConnection.PingServer

  • it seems this methods are useless or incorrect

The situation:

I write code in a loop fetching some data one per second (SELECT)
Every loop I check:

if TZConnection.PingServer then
if TZConnection.Connected then
   // Fetch one row with TZQuery and close dataset

While my app is working I stop Firebird service via Administration/Services
I hope that .Ping() or .PingServer() will return false in next loop.

But instead I get the exception SIGSEGV:

ZPlainFirebird.pas
line 4114: ReferenceCountedVTable(vTable).addRef(Self);

So, how can i make sure the connection is not dropped?
For example, if the network or FB-server is down

Discussion

  • sundoctor

    sundoctor - 2021-05-25
    • summary: TZConnection.Ping / PingServer with network down --> FB3 + TZConnection.Ping / PingServer with network down
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
    +I notice Firebird 3 connection problem.
    +
     TZConnection.Ping
     TZConnection.PingServer
    
     
  • Fr0sT.Brutal

    Fr0sT.Brutal - 2021-05-26

    Seems like bug indeed but why you need to ping? Just execute query and check results/exceptions

     
  • sundoctor

    sundoctor - 2021-05-27

    I think Ping - is a lightweight operation and much faster then query. It's comfortable to use .Ping as a background process and so on.

     
  • marsupilami79

    marsupilami79 - 2021-05-27

    There is a feature request to implement ping for the new Firebird driver. As far as I understand it, PinServer doesn't work correctly on Firebird (yet).

     
  • marsupilami79

    marsupilami79 - 2021-08-27

    Hello,

    ZPlainFirebird.pas
    line 4114: ReferenceCountedVTable(vTable).addRef(Self);

    I think I might have solved that yesterday in [r7647] / [r7648]. Could you please test the current SVN again?

    Best regards,

    Jan

     

    Related

    Commit: [r7647]
    Commit: [r7648]

  • marsupilami79

    marsupilami79 - 2021-08-27

    Another note: Zeos 8.0 will raise an EZConnectionLost exception when you do something and the server has stopped responding. So you might do the row fetching and wait for that exception without doing ping.

     

Log in to post a comment.