SQL Server Disconnect
SQL Server Disconnect
I am having problems with sql server disconnecting my application arbitrarily. Is there a way I can get the tunisession to detect the disconnection and automatically reconnect. It seems I don't know of a disconnection until another query is executed. I want to be able to automatically connect and re execute the current query.
Re: SQL Server Disconnect
I have tried to set the session to disconectedMode = true and localFailover = true.
When I do the onconnectionlost event does not execute, instead the onsessionerror event is triggered. I was expecting the onconnectionlost event to be triggered. Is this normal behavior?
When I do the onconnectionlost event does not execute, instead the onsessionerror event is triggered. I was expecting the onconnectionlost event to be triggered. Is this normal behavior?
Re: SQL Server Disconnect
Please specify what exact component you are using to connect to SQL Server because TUniConnection does not have the onsessionerror event.
The TUniConnection.OnConnectionLost event does not occur at the moment when a connection to SQL Server is lost. This event occurs when UniDAC refers to the server and by that time the connection will be already lost. To use OnConnectionLost set the TUniConnection.Options.LocalFailover property to True. See more details in the documentation: https://www.devart.com/unidac/docs/?dev ... ilover.htm
You can find a sample of using OnConnectionLost in the FailOver demo project located in the subfolder "Demos\Miscellaneous\FailOver\" relative to the path where you have installed UniDAC demo projects.
The TUniConnection.OnConnectionLost event does not occur at the moment when a connection to SQL Server is lost. This event occurs when UniDAC refers to the server and by that time the connection will be already lost. To use OnConnectionLost set the TUniConnection.Options.LocalFailover property to True. See more details in the documentation: https://www.devart.com/unidac/docs/?dev ... ilover.htm
You can find a sample of using OnConnectionLost in the FailOver demo project located in the subfolder "Demos\Miscellaneous\FailOver\" relative to the path where you have installed UniDAC demo projects.