Hello, I have question how to check if Client datasnap loss connection from server?
Hello, I have question how to check if Client datasnap loss connection from server?
i try use :
if SQLConnection1.Connected then
ShowMessage('Connected')
else
ShowMessage('DisConnect');
but this not work. if Server disConnect condition of SQLConnection still connected.
Thanks you
i try use :
if SQLConnection1.Connected then
ShowMessage('Connected')
else
ShowMessage('DisConnect');
but this not work. if Server disConnect condition of SQLConnection still connected.
Thanks you
What I did was to add a global handler for unhandled exceptions, where I parse the exception to get the db error code. If it's a disconnect I show a dialog informing the user and call Application.Terminate. Not the most elegant but works.
ReplyDeleteWhich type of connection are you using? TCP/IP or HTTP? For TCP/IP there is a keepalive mechanism that can let you track the status of a connection...
ReplyDeleteIm using TCP/IP, keepalive mechanism in server or client marco?
ReplyDelete