|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO Connection terminates automatically after one hourHi,
I am facing some problem with ADO connection to SQL Server. My application connects to SQL Server through ADO, excute some query and then for more than an hour application does not use this connection. It does something else. But when again it tries to use that connection, that connection is no longer exist and SQL Server gives following error: "General network error. Check your network documentation." Through profiler I have find out that SQL Server terminates that connection exactly after one hour. Can anyone explain this behavior of ADO/SQL Server? What shall I do to avoid this? Thanks in advance. Pushkar Have your application check the status of the connection, and open it if it
is not already open. Soon as you are done with the connection close it until you need it again. Keeping the same connection open for an hour when it is not in use is going to waste resources. Show quote "Pushkar" <pushkartiw***@gmail.com> wrote in message news:usNGiGviGHA.3572@TK2MSFTNGP04.phx.gbl... > Hi, > I am facing some problem with ADO connection to SQL Server. > My application connects to SQL Server through ADO, excute some query and > then for more than an hour application does not use this connection. > It does something else. > But when again it tries to use that connection, that connection is no longer > exist and SQL Server gives following error: > "General network error. Check your network documentation." > > Through profiler I have find out that SQL Server terminates that connection > exactly after one hour. > Can anyone explain this behavior of ADO/SQL Server? > What shall I do to avoid this? > > Thanks in advance. > Pushkar > > Hi
Have a look at your network. You might have routers that close ports when inactive for a long time. SQL Server and ADO do not automatically close connections. Regards --- Mike This posting is provided "AS IS" with no warranties, and confers no rights. Show quote "Pushkar" <pushkartiw***@gmail.com> wrote in message news:usNGiGviGHA.3572@TK2MSFTNGP04.phx.gbl... > Hi, > I am facing some problem with ADO connection to SQL Server. > My application connects to SQL Server through ADO, excute some query and > then for more than an hour application does not use this connection. > It does something else. > But when again it tries to use that connection, that connection is no > longer exist and SQL Server gives following error: > "General network error. Check your network documentation." > > Through profiler I have find out that SQL Server terminates that > connection exactly after one hour. > Can anyone explain this behavior of ADO/SQL Server? > What shall I do to avoid this? > > Thanks in advance. > Pushkar > |
|||||||||||||||||||||||