Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A connection was successfully established with the server, but then an error occurred during the pre-login handshake / Login process

I develop an SMS Server that receive SMS, Analysis them and reply to messages. This application developed with entity framework 4.0 and SQLServer 2008.

When I receive SMS I run new thread for that message and analysis and response to message. Each thread has its own new instance of object context and all threads call same stored procedure in SQL Server.

But when large number of SMS arrived to server and number of thread increase, I get one of these 2 error each time:

The underlying provider failed on Open. A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (Provider: TCP Provider, error: 0 - The specified network name is no longer available.)

OR

The underlying provider failed on Open. A connection was successfully established with the server, but then an error occurred during the login process. (Provider: TCP Provider, error: 0 - The specified network name is no longer available.)

I increase Max Pool Size and Connect Timeout to 400 and 150. Can anyone help me?? Thanx

like image 664
Vahid Jafari Avatar asked Nov 27 '10 05:11

Vahid Jafari


People also ask

Could not connect to server a connection was successfully established with server but then error occured during login process?

The reason for this common error is that by default MS SQL Server runs in “Windows Authentication mode”. And you will need to change it to “SQL Server and Windows Authentication mode” by following the steps below: Launch SQL Server Management Studio. Log into your SQL Server using Windows Authentication.

What is a pre Login handshake?

Pre-login handshake means IP range needs added to Firewall.


2 Answers

You might try increasing the timeout setting in SQL Server. The default is 10 minutes.

http://msdn.microsoft.com/en-us/library/ms189040(v=sql.105).aspx

like image 179
Scotty Boy Avatar answered Nov 15 '22 04:11

Scotty Boy


Might be because some connections still get available. Try to do this :
sp_configure 'user connections', 0 go reconfigure with override

Also check your server properties, in Connections section, that your parameter : Maximum number of concurrent connections is set to 0 (unlimited).

like image 27
KrasshX Avatar answered Nov 15 '22 06:11

KrasshX