Menu

#31 Implementing the PingServer method in the TZFirebirdConnection, like such in the TZInterbase6Connection

None
open
2021-04-20
2021-04-15
No

It would be nice to implement the PingServer method in the TZFirebirdConnection, like such in the TZInterbase6Connection.

Now the TZAbstractDbcConnection.PingServer function is called, which throws the EZUnsupportedException exception:

[code]
Raise EZUnsupportedException.Create(SUnsupportedOperation);
[/code]

[code]
/ TZInterbase6Connection - has overrided method PingServer: Integer; override;
TZAbstractDbcConnection <-- TZInterbaseFirebirdConnection
\ TZFirebirdConnection - no PingServer method
unit ZDbcConnection

declared
TZAbstractDbcConnection = class...
function PingServer: Integer; virtual;
[/code]

Discussion

  • EgonHugeist

    EgonHugeist - 2021-04-20
    • labels: firebird, ping --> firebird, ping, OO-API
    • assigned_to: EgonHugeist
    • Milestone: -->
     
  • EgonHugeist

    EgonHugeist - 2021-04-20

    Hello Vladimir,

    PingSetver added by r7464 on trunk.
    Please close if OK.
    Regards, Michael

     
  • Vladimir Lomov

    Vladimir Lomov - 2021-04-20

    Hello, Michael!

    I am not sure what is the problem, but after I call the PingServer after restarting the Firebird server, an error occurrs.

    I use mORMot2 and ZeosLib last trunk versions.
    Debian 5.10.28-1 (2021-04-09) x86_64 GNU/Linux
    FPC/Lazarus

    That's what I'm doing:

    1. connect to the database;
    2. query a database - OK;
    3. execute PingServer - OK;
    4. query a database - OK;

    5. restart the Firebird server:
      sudo systemctl restart firebird

    6. execute PingServer - an error occurs:

    7. in the TZFirebirdConnection.PingServer() function, the FAttachment.Ping(FStatus) function is calling (Fstatus);
    8. in the ZPLainFireBird unit, IAttachment.ping(status: IStatus) procedure is executed;
    9. in the IAttachment.ping() procedure, the AttachmentVTable(vTable).ping(Self, status) is called, and at this moment there is an exception:

      Project Test Application Server raised exception class 'External: SIGSEGV'.
      In file '../../src/plain/ZPlainFirebird.pas' at line 4114:
      ReferenceCountedVTable(vTable).addRef(Self);

      OK
      F9

      Project Test Application Server raised exception class 'RunError(216)' with message:
      General Protection Fault
      In file '../../src/plain/ZPlainFirebird.pas' at line 4114:
      ReferenceCountedVTable(vTable).addRef(Self);

      Continue

      Project Test Application Server raised exception class 'EAccessViolation' with message:
      Access violation
      In file '../../src/plain/ZPlainFirebird.pas' at line 4114:
      ReferenceCountedVTable(vTable).addRef(Self);

      Best regards, Vladimir

     

    Last edit: Vladimir Lomov 2021-04-20

Log in to post a comment.

MongoDB Logo MongoDB