?
Solved

NETWORKIO Problem

Posted on 2006-03-22
7
Medium Priority
?
397 Views
Last Modified: 2008-01-09
Hello,

   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.

 


0
Comment
Question by:svingal
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:IT-Schubertz
ID: 16256884
Hi,

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


HTH

Andy
0
 
LVL 2

Author Comment

by:svingal
ID: 16257345
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.




0
 
LVL 7

Expert Comment

by:IT-Schubertz
ID: 16257692
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.

hth

Andy


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 2

Author Comment

by:svingal
ID: 16258021
Hello,

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.


Svingal
0
 
LVL 7

Accepted Solution

by:
IT-Schubertz earned 500 total points
ID: 16258096
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.

Andy
0
 
LVL 2

Author Comment

by:svingal
ID: 16266438
Thanks much for the support.
Have a nice day.

Svingal
0
 
LVL 7

Expert Comment

by:IT-Schubertz
ID: 16267216
HI,

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.

Andy
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question