September 9, 2005 at 8:04 am
Hello everyone,
We have a really strange problem. I know how to solve it but I would understand it before to solve it.
Here is the problem:
We are using ADO.NET to connect to a SQL Server 2000 with our application. The network protocole that is used to connect to the database is TCP/IP.
In one functionnality that was poorly coded we disconnect en reconnect to the server many times in a really short interval.
At about the 4000th times we try to reconnect we have this exception:
SQL Server does not exist or access denied. at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin() at System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection connection, SqlConnectionString connectionOptions) at System.Data.SqlClient.SqlConnection.Open() at dtbmsq_Connection_c.OnConnect(dtbmsq_Connection_c* ) in s:\ogl20053\src\odbmsq\dtbmsq\dtbmsq_connection_c.cpp:line 262
But if I change the network protocole and use the Named Pipes instead it works. No problem.
Any idea on what should I check? On how to deal with this weird kind of problem?
Any hint will be welcomed.
Regards,
Carl
September 9, 2005 at 10:58 am
I talked with my network guy and we finally found the problem.
TCP/IP was establishing sessions using ports ranging from 1024 to 5000.
But the fact that we were closing our connections in ADO.NET did not mean that the session spawned was also closed at the same time. In fact TCP/IP kept those sessions "alive" (status TIME_WAIT) for few minutes in the background fro us.
So, at the speed we were openning and closing TCP/IP connections, we reached the ports number 5000 (limits), before TCP/IP had time to free theses sessions (and ports).
When no more ports were left we got exception:
SQL Server does not exist or access denied
In this exception it was only the part "access denied" of the error message that was involved in our case.
Have a nice day everyone,
Carl
September 9, 2005 at 11:13 am
Thanx for the troubleshooting... should help somebody in the future.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply