Disabling opportunistic locking

We seem to have exaclty the same situation at one of our clients that happened in EE question

(They have a Windows 2003 Server with mainly Win XP clients)


It refers to a soluiton from MS to disable opportunistic locking

In the MS Solution


It describes how do do it via the registry, but I'm confused. Firstly does it mean on the server or client workstations? Secondly there is no key in the registry path it specifies:

OplocksDisabled REG_DWORD

All I have is: "CscEnabled"=dword:00000001

On either the XP workstatins or on the server. Does it mean I should add it?

Thirdly, do I need to do all the reg key changes it refers to?

All explanations greatly received.
Who is Participating?
Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
As I understand things, yes. I used to develop EPOS software using Windows and DOS. Tills would be DOS or Win98SE and later XP. As the app was peer-to-peer, no real "server" needed, so a bigger workstation was used for the file hosting.

Worked well.

I'm not an expert on the locking, but in essence, the locks were held locally and only sent to the "server" when necessary.

In a multi-user realtime system, this is a problem.

There are some issues with speed, certainly, but speed vs. accuracy .... well, accuracy wins every time.

And in truth, the amount of network delay was negligible for our app. Most of the time the app is waiting on the user to do something (scan a barcode, counting change, waiting for receipt printer, etc.).

Richard QuadlingSenior Software DeveloperCommented:
If the entry doesn't exist, create it.

I used to have to do this for the Sage Line 50 and Line 100 apps (DOS and Windows based).

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html#id2584291 covers everything. It is a lot to read though.

Richard QuadlingSenior Software DeveloperCommented:
If you use a tool like RegMon, you'll see a LOT of keys that don't exist being accessed. They all have their default values.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

gerlisAuthor Commented:

Does it need to be done on the server as well as the workstation(s)?

gerlisAuthor Commented:
Thanks, in our case we do need the speed!  If a file is opend directly through the application i.e. Word or Excel then navigate to the file, it opens quickly. If accessed direct on the mapped drive on the server it's very very slow to open.  Problem only applies to Word & Excel, pdfs for example are fine. The orginal EE questin is exactly what our client is experiencing.

This is what I've done so far, but didn't seem to make much difference in opening files from the server, it's still very slow.

I added (on server and a Win XP workstation):

OplocksDisabled REG_DWORD 0 or 1
Default: 0 (not disabled)

I set it to 1

I added (on server and a Win XP workstation)

EnableOplocks REG_DWORD 0 or 1
Default: 1 (enabled)

I set it to 0

I restarted both server and workstation

Do I need to do the other three registry value changes/additions as mentioned on the MS article?
Any idea why this has just started to happen on this network?
Richard QuadlingSenior Software DeveloperCommented:
Locking in this way is co-operative. All users MUST use the same mechanism for the locking to be effective.

If user A is NOT passing the lock down to the hosting machine, other users won't see it. And confusion ensues.

There are a several settings. I'm still looking for the regex I used to use ... But over 8 years ago ...


http://www.superbase.com/services_tech_support_oplocks.htm ((C) 2003)


http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html This is the article to read. It is all there. No matter what I've said, it was all based upon memory of this article. So. Read this one and see what you need to do.

But it seems you've probably already done it.

gerlisAuthor Commented:
Thanks, I'll take a detailed look at it later today and tomorrow

Much appreciated
gerlisAuthor Commented:
I read tyhe article and although more aobut data access, it is still relevant, but, as you say, I have already done the things for disabling oplocks in the registry.

It seems to be affecting most users on the network. It is only Word & Excel documents when accessed on the server, pdfs are fine. If the applicatin is opened first, e.g. Word and the file is accessed from the server that way, it opens fine.

On two of the client PCs (Win XP) i have made the registry changes, and also on the server. At the end of last week it seemed to improve, also yesterday, but today it is back to its old self.

Interestingly, one of their machines has Windows Vista and this is absolutely fine.

Any further ideas?
Richard QuadlingSenior Software DeveloperCommented:
I would use something like ProcMon to see EXACTLY what activity is happening in regards to the files in question.

I don't know Vista or Win7 or what/how the locking may (or not) have changed.

If you need more help, please use the "Request Attention" button as I'm pretty much out of ideas at the moment.
gerlisAuthor Commented:
Thanks, anyway. I will see if I can use the ProcMon.

I'll keep you posted
gerlisAuthor Commented:
The problem is still a bit intermittent on the users's system but not causing any real difficulties, there are simple ways round it, such as opening Word first then selecting the file from the server.

Nonetheless I learnt some new things here, thanks.
gerlisAuthor Commented:
The problem is still a bit intermittent on the users's system but not causing any real difficulties, there are simple ways round it, such as opening Word first then selecting the file from the server.
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.

All Courses

From novice to tech pro — start learning today.