I have, Delphi, BDE, OBDC(named pipes connection) application using MSSQL server 2000.
  When the user open the table, he create's NETWORKIO locked spid.
  When the user closes the app the spid disappears.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


although I don't see what your app really does, I think you got a blocking problem:
Reader is blocked by (waiting on) NetworkIO
SQL Server has to buffer results at the client and at the server. If the client buffer isn't clearing out fast enough to allow the server buffer to clear, you leave NETWORKIO locks.
The solution is to not leave any results unread before attempting an update.
You should be able to solve this by using WITH NOLOCK in your Select statement

A common scenario where this happens is:
Do a SELECT query.
For every row, do some tests at the client application level
For certain rows, issue an UPDATE against that row.

this leaves you in the following situation:
Updater is blocked by Reader
Reader is blocked by (waiting on) NetworkIO.

Since Reader is not reading, the NetworkIO lock will never be released. You are not deadlocked because the Reader is not waiting on the Updater - it is waiting on itself (the client).


svingalAuthor Commented:
In the delphi application is  TDataSet component on whitch i make Locate.
When the locate is done, the NETWORKIO spid appears until i do some query like
select top 1 * from table, or insert, post, or close the dataset. Then the spid disapears.

Why the locate function in Delphi BDE DataSet leaves runnig NETWORKIO waiting spid on server?

Thanks much for reply.

Well, I am not a Delphi expert, but maybe this helps explaining:

"The TDataSet.Locate method is a good way to find the record matching a specific value. However, calling this method forces the ExpressDataController to reload all records. This may significantly affect performance, especially when operating with huge amounts of data.
Calling the Data Controller's BeginLocate and EndLocate methods allow you to prevent it from excessive reloading of data. If you need multiple calls to the TDataSet.Locate method, enclose this part of the code with BeginLocate and EndLocate."

Obviously if you are done loacting, there have to be massive data reloads. since this is going over a network (and maybe your table is quite big), that combined with my first explanation would explain the error.



Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

svingalAuthor Commented:

Currently in Delphi 6, the TDataSet object don't have BeginLocate or EndLocate method.
What can i use instead of this??

Thanks much for comment.

I am sorry, but I must pass this question.
As I stated, I am no delphi expert and my last practical work with it is quite some time ago. Even then I used to use direct ADO objects rather than BDE objects.
Maybe you get an answer for that in the programming\delphi group.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
svingalAuthor Commented:
Thanks much for the support.
Have a nice day.


why did you rate my answers with C? this is a slap in the face of the answering person.
I mean, you had a very difficoult question - noone else here could give you any hint.
I was luckily able to shed some light on the issue finally by pointing you to the right direction.
Your problem is obviously caused by a Delphi component. You can't expect to find a 100% correct explanation about a Delphi component problem in a SQL Server database.
And the rating you gave me is that bad that I'd rather be without a rating.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.