We help IT Professionals succeed at work.


svingal asked
Medium Priority
Last Modified: 2008-01-09

   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.


Watch Question


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).




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.





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.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


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.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.