Skip to Content.
Sympa Menu

freetds - Re: [freetds] 20047: DBPROCESS is dead or not enabled

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: John Kendall <john AT capps.com>
  • To: FreeTDS Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 20047: DBPROCESS is dead or not enabled
  • Date: Mon, 19 Sep 2016 16:00:44 +0000


> On Sep 19, 2016, at 5:44 AM, LacaK <lacak AT zoznam.sk> wrote:
>
> Hi,
>
> I am using FreeTDS dblib as client library which connect to SQL Server 2012.
> I am using application which runs in background and sometimes queries SQL
> Server.
>
> But when computer where application runs comes into sleep mode, after
> wakeup next query fails with above mentioned error.
>
> It is expected, because SQL Server sends keep alive packet and client does
> not respond, so SQL Server resets connection.
>
> My question is if there is an elegant way how to handle this situation ?
> How to detect dead dbprocess (there is dbdead(), but I can use this
> function only after failed query; I can not check status of connection
> before I send query?) ?
>
> Or only way is catch exception, check if it is error 20047 and if yes, then
> connect again and send query again ?

This is what I did. Although it seemed like a distasteful solution
initially, once implemented it worked so well, I got over it. :)

> Thanks
>
> -Laco.
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page