Thursday, February 16, 2012

ADO Connection terminates automatically after one hour

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.
PushkarHave 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.
"Pushkar" <pushkartiwari@.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.
"Pushkar" <pushkartiwari@.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
>

No comments:

Post a Comment