Recent

Author Topic: zeoslib: check if mysql connection is alive  (Read 7371 times)

giulianoz

  • Newbie
  • Posts: 2
zeoslib: check if mysql connection is alive
« on: December 19, 2009, 03:25:33 pm »
Hello,
 Is it possible to check if a previously connected TZConnection (mysql protocol if that matters) is still active ? I've tried to check the connected propertiy but it doesn't change when I stop the mysql server. Also the AfterDisconnect event isn't fired when the server goes down.

OS and server are on fedora 12 64bit pc, fpc/lazarus/zeoslib compiled from svn/source today

thanks

giuliano

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: zeoslib: check if mysql connection is alive
« Reply #1 on: December 19, 2009, 04:02:30 pm »
Connected & AfterDisconnect doesn't work in such way.
Zeos don't know if server went down. You have to ping it, so if ping is false, then execute connection.Disconnect.

giulianoz

  • Newbie
  • Posts: 2
Re: zeoslib: check if mysql connection is alive
« Reply #2 on: December 19, 2009, 04:16:12 pm »
Thanks for the info, I'll do some ping checks

 

TinyPortal © 2005-2018