views:

192

answers:

3

I know there is a lot of information in the Internet about solving this problem, but it didn't help me.

My Delphi application uses dbExpress controls to access the database and execute SQL queries. Once every couple of days, however, it stops working because the database connection fails. This happens on several different computers with different versions of Windows. MSSQL Server 2005 (version 9.0.4035) is installed on each of them.

The above mentioned application executes queries every couple of seconds, and they are mainly insert commands. Every couple of days I get a series of exceptions like the following one:

[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error. Check your network documentation.

And then the SQL server becomes inaccessible until I restart it manually.

The information I found in the Internet say that I should install some service packs, change some registry entries etc., but believe me, none of these helps and I don't know what else to do now.

Could you please help me solve this problem? Any clues or ideas? I can give you some more information about the server or the application if necessary.

Thank you very much in advance.

+1  A: 

Can you please answer the following -

  1. Are you using linked server while inserting ?
  2. Can you put monitoring in place in Sql server and check if the memory and cpu usage is not getting screwed.
  3. Can you check the transaction log and see if it is growing rapidly.
  4. Check the eventviewer and see what is happening.

Usually the error above indicates that there is some problem with the sql server. I used to get this when my application used to access a linked server.

Prashant
No, I'm not using linked server. I have no access to these computers right now, but I'll do all you suggest tomorrow. Is there anything else I should pay attention to? Thanks for your suggestions.
Mariusz
Did you try these ?
Prashant
I'm sorry, but I didn't manage to get any information yesterday and I won't be able to do that for next few days :-(. I didn't say that, but all these troubles happen to the clients of the company I work at and not always do they have time to respond to our requests, in this case concerning these points. What's more, I'll be out of office for a week so I won't be able to contact them. But I will not forget to do that when I'm back. Thanks for your your help anyway!
Mariusz
+1  A: 

What's your connection string look like? Are there firewalls (hardware or software) between the network connections?

Check out this link for ideas http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx

Re-reading your post, it's quite interesting that you need to restart SQL Server..that's a pretty serious deal. Normally these network errors are fleeting due to non-sql related items. Perhaps you are not closing all your connections properly. Do a "netstat -an" on the SQL server and see how many tcpip connections are lingering around. Look in enterprise manager as well. Since you had to restart SQL Server, the first thing I'd look at is the Error logs of SQL Server itself and then the windows event logs.

Next step after looking at all this and if you are still experiencing problems then I would highly recommend to open up a trouble ticket with Microsoft. It's typically not expensive and they are quite good at this sort of thing.

Darian Miller
Thanks for your answer. If it comes to the connection strings, they look either this way:DriverName=MSSQL;HostName=(LOCAL)\InstanceName;OS Authentication=False;User_Name=sa;Password=123456;or that way:DriverName=MSSQL;HostName=(LOCAL)\SQLEXPRESS;OS Authentication=True;As you can see, the application is run on the same computer where the SQL Server is running. If it comes to the firewalls, I would have to check that out (unfortunately only in the end of next week), but I think there are none of them (or if there are any, they are switched off).I'll try your suggestions ASAP.
Mariusz
Let me write those connection strings in separate comments so they are clear...
Mariusz
DriverName=MSSQL;HostName=(LOCAL)\InstanceName;OS Authentication=False;User_Name=sa;Password=123456;
Mariusz
DriverName=MSSQL;HostName=(LOCAL)\InstanceName;OS Authentication=True;
Mariusz
A: 

I finally got the log files of the sql server and they say:

2010-05-15 08:26:44.55 Logon
Login succeeded for user 'ZARZĄDZANIE NT\SYSTEM'. Connection: trusted. [CLIENT: 192.168.1.100]

2010-05-15 08:26:45.30 spid57
Error: 701, Severity: 17, State: 123.

2010-05-15 08:26:45.30 spid57
There is insufficient system memory to run this query.

2010-05-15 08:26:46.60 Logon
Login succeeded for user 'ZARZĄDZANIE NT\SYSTEM'. Connection: trusted. [CLIENT: 192.168.1.100]

The 'login succeeded for user...' entry repeats about 300 times in total before an AV exception occurs:

2010-05-15 08:27:32.72 Server
CImageHelper::Init () Version-specific dbghelp.dll is not used

2010-05-15 08:27:32.72 Server
CImageHelper::Init () Failed load of dbghelp.dll - Not enough storage is available to complete this operation.

2010-05-15 08:27:32.77 Server
CImageHelper::Init () Version-specific dbghelp.dll is not used

2010-05-15 08:27:32.77 Server
CImageHelper::Init () Failed load of dbghelp.dll - Not enough storage is available to complete this operation.

2010-05-15 08:27:32.77 Server
***Symbol load failed - Proceed to dump without any symbols

2010-05-15 08:27:32.77 Server
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server \MSSQL.1\MSSQL\LOG\SQLDump0009.txt

2010-05-15 08:27:32.77 Server
SqlDumpExceptionHandler: Process 5364 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

2010-05-15 08:27:32.77 Server * BEGIN STACK DUMP:

2010-05-15 08:27:32.77 Server *
05/15/10 08:27:32 spid 0

2010-05-15 08:27:32.77 Server *
Exception Address = 47DB86B4 Module(UNKNOWN+00000000)

2010-05-15 08:27:32.77 Server *
Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION

2010-05-15 08:27:32.77 Server *
Access Violation occurred reading address 00000008

2010-05-15 08:27:32.77 Server * MODULE BASE
END SIZE

2010-05-15 08:27:32.77 Server *
Edi: 47E31E90: 00020066 00000000 00000000 00000000 00000008 E70F1AA0 2010-05-15 08:27:32.77 Server *
Esi: 47E31E90: 00020066 00000000 00000000 00000000 00000008 E70F1AA0

2010-05-15 08:27:32.77 Server *
Eax: 00000000:

2010-05-15 08:27:32.77 Server *
Ebx: 77E3FC30: 00000A18 00000DBC 00000000 00000000 00000000 00000000

2010-05-15 08:27:32.77 Server *
Ecx: 00000004:

2010-05-15 08:27:32.77 Server *
Edx: 7C93860C: 24A48DC3 00000000 0024648D 0824548D 55C32ECD A48DEC8B

2010-05-15 08:27:32.77 Server *
Eip: 47DB86B4: F704518B 8BC223D0 0B042454 044189C2 900008C2 90909090

2010-05-15 08:27:32.77 Server *
Ebp: 00000DBC:

2010-05-15 08:27:32.77 Server *
SegCs: 0000001B:

2010-05-15 08:27:32.77 Server *
EFlags: 00010202: 004D0055 00450042 005F0052 0046004F 0050005F 004F0052

2010-05-15 08:27:32.77 Server *
Esp: 02D9FB34: 47DBFCDC 00000001 00000000 34491F20 00000000 02D9FBBC

2010-05-15 08:27:32.77 Server *
SegSs: 00000023:

2010-05-15 08:27:32.77 Server * Short Stack Dump

2010-05-15 08:27:32.77 Server
47DB86B4 Module(UNKNOWN+00000000)

2010-05-15 08:27:32.77 Server
Stack Signature for the dump is 0x47DB86B4

I'm wondering what may cause this problem. Do you have any idea that could help me?

Thank you.

Mariusz