Re: WSAECONNREFUSED on a TCP socket breaks an open ADO connection.
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Fri, 27 May 2005 19:48:11 -0700
I expect that the operation in question is damaging (crashing) the pooled
connection--the link between the server and your client system. This might
not remove it from the pool so when you reopen the connection, you might get
the same (bad) connection. To test this theory, the next time you get this
exception, change the connection string before you try to reopen the
connection. If this works, it means one (or more) connections in the pool
are damaged. At this point you can stop the application entirely to flush
the pool, continue to use a different connection string (which will orphan
the contents of the pool--all its connections will remain open for 4-8
minutes unless they had been marked as closed), or wait until ADO 2.0 which
offers more options to flush the pool.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Ricardo Vazquez" <rvazquez@xxxxxxxxx> wrote in message
news:%23ln94GgYFHA.2768@xxxxxxxxxxxxxxxxxxxxxxx
> In the same program I have an open ADO database connection to SQL Server,
> and a TCP socket.
> When the socket tries to connect to a service that is inactive, the
> connect
> statement returns WSAECONNREFUSED (10061) --> that's Ok.
> BUT when I try to write this error on the database, ADO throws this error:
> 0x80004005 [DBNETLIB][ConnectionWrite (send()).] General network error.
>
> After this has happened:
> - I can't write to the database any more: I get 0x80004005 Connection
> Error.
> - If I try to destroy the database object, create it again and open the
> database again I get this error: 0x80004005 [DBNETLIB][ConnectionOpen
> (Connect()).] SQL Server does not exists or access has been denied. But,
> obviously the database is still there and I can reach it throught any
> other
> program or restarting mine!
>
> Does anyone know what can be happening?
> How can I prevent or avoid this unsolicited shut down of the database
> connection?
> In case that this is not possible, is there any way to successfully
> restart
> my connection to the database?
>
> Thank you very much in advanced,
>
> Ricardo Vázquez.
> Madrid, Spain.
>
>
.
- References:
- WSAECONNREFUSED on a TCP socket breaks an open ADO connection.
- From: Ricardo Vazquez
- WSAECONNREFUSED on a TCP socket breaks an open ADO connection.
- Prev by Date: Re: ADODB.Recordset Open progress indicator
- Next by Date: Re: Newbe Question
- Previous by thread: WSAECONNREFUSED on a TCP socket breaks an open ADO connection.
- Next by thread: ADODB.Recordset Open progress indicator
- Index(es):
Relevant Pages
|
|