Deb's SQL Blog

This is where the subtitle goes :)

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

Subscriptions



One very annoying error...."General network error. Check your network documentation"

First of all I am sorry that I am not able to go to PDC. It sounds like a blast :) I always seem to not make the list of those whom work will pay to send and its a little high for me to pay for it out-of-pocket.

The past few weeks I have been programming a web service in c# that utilizes a few nice things.  I'm passing around authentication tickets created by the forms.authentication class into all of the methods in order to exploit  a role-based security model that the service is implementing.

After running through my role-discovery algorithm that is based on information from the windows network, and  a special roles table in the SQL server 2k database that the service can connect too, the permissions on the database are set by activating application roles.  This part works as designed.  I have SQL server application roles activating for the right reasons and the permissions are set on the connection correctly.  However I have spent the better part of three days hunting down the source problem behind the intermittant error that I reference in the title.

My environment for developement is MSDE (sp3), .net framework 1.1 and IIS (exact version forgotten).  All running on the same machine. The test client would be able to call the methods of the webservice fine 1 time, maybe a second time, and then boom!--General network error blah blah blah. I noticed right away I had extra connections on SQL server after the client disconnected. First though I had was 'ok--forgot to call a close() on a connection somewhere'.  Traced though the webservice and yes--close() was being called. Second thought--maybe the connection object needs to be disposed so i called dispose(), tested the client, same results, worked first pass, failed randomly on subsequent runs.  Started the IDE in debug mode and stepped through the webservice line by line and yes--the close() and dispose() were actually being called.  So I called the garbage collector and forced it to collect garbage for all generations. Reran the client--”general network error”.  At this point I decided I needed something chocolate....others would have probably gone for beer :) or to smoke. It was getting pretty frustrating.  I finally started commenting out steps of the webmethod's logic.  After commenting out the call to “sp_setapprole”,the client worked. Ok, w/o permissions to anything, but it was working and I was getting normal 'permission denied' errors. Hmmm.

Found this case on the knowlege base:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q229/5/64.asp&NoWebContent=1

Turned off resource pooling on the connection string as the case suggested and my problems have for now gone away. No more ghost connections. No more “General Network Error” gremlins.

Considering this is my first real webservice application, I was almost euphoric that i finally got around this demon.   I did some research on this error and it seems that one definitely needs to have the MSDE at service pack 3 for other reasons that cause the same-named error. The thing is a catch-all for sure and has many causes. I have also found that I needed to be careful about dispose()'ing of objects dealing with SQL server 2000.

So I wrote this up hoping that it might help someone else who might be visited by this demon. I think problems like this are what is turning my hair grey :(.

--debora

posted on Wednesday, October 22, 2003 7:26 PM by orfda





Powered by Dot Net Junkies, by Telligent Systems