Debugging applications

Debugging applications

Debug applications which use Mediator Delphi components in exactly the same way as any other database applications. Thanks to the supplied component source code, debugging is easy and efficient.

There is one think you should remember when debugging applications which open connection to Mediator server. To ensure maximum realiability, Delphi application send a keep-alive message to Mediator server every 40 seconds. This allows Mediator server to quickly detect network or client application failures, close the connection and free all resources allocated by application. When debugging, the thread sending keep-alive messages can be stopped. When no more keep-alive messages are sent, Mediator server will close the connection and you will receive the "Network connection lost" exception. To eliminate this problem, call

TMedConnection.MedDiscTm(65535);

right after opening the connection. This will turn off the keep-alive mechanism and Mediator server will not disconnect application even if it is stopped in debugger. For production applications, remove the above call to ensure best realiability in multi-user environments.