Home All Groups Group Topic Archive Search About

ADO Connection terminates automatically after one hour

Author
8 Jun 2006 11:49 AM
Pushkar
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

Author
8 Jun 2006 1:51 PM
Jim Underwood
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
>
>
Author
8 Jun 2006 3:41 PM
Michael Epprecht [MSFT]
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
>

AddThis Social Bookmark Button