none
Opportunistic Locking

    Question

  • Hello All,

    I am setting up an environment for 10 users running XP and Windows 7, no Vista, accessing a Windows Server 2008 R2 Standard File Share [Testing on a 90 Day Trial].  This is for an engineering firm that is having a problem with more than one user trying to save to a file.  We are trying to avoid the "interceding update" issue.  My understanding is that if I enable opportunistic locking on XP and 7 in the Registry, [

    key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MRXSmb\Parameters\

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

    ]
    then I will get the desired effect of a user trying to save to an open file being denied write access when they try to save.
    As it stands now, if I open a file on a Windows 7 client, then open it on a Windows XP client, alter the file on XP and try to save it, I am denied.  This is the desired behavior.  However when I flip the scenario, a file opened first in XP, then 7, 7 will write over the file.  This is not the desired bahvior.  I would like Windows 7 client to not be able to write over a file already opened by a Windows XP client.
    If anyone has a solution I would be very appreciative. 
    Cheers,
    notChrisKnight
    • Edited by notchrisknight Thursday, November 04, 2010 11:10 PM clarification
    Thursday, November 04, 2010 11:07 PM

Answers

  • Hi,

    As you mentioned "no Windows Vista", I assume you have read the following article:

    http://support.microsoft.com/kb/q296264/

    Windows 7 is using the same structure as Windows Vista, so I'm afraid we will not able to disable Opportunistic Locking on Windows 7 as well.

    Notes for Windows Vista

    The opportunistic locking registry keys are valid only for traditional SMB (SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was introduced in Windows Vista to enable faster communication between computer that are running Windows Vista and Windows Server 2008 or Windows Server 2008 R2.


    Shaon Shan| TechNet Subscriber Support in forum| If you have any feedback on our support, please contact tngfb@microsoft.com
    Wednesday, November 10, 2010 6:23 AM

All replies

  • Hi,

    As you mentioned "no Windows Vista", I assume you have read the following article:

    http://support.microsoft.com/kb/q296264/

    Windows 7 is using the same structure as Windows Vista, so I'm afraid we will not able to disable Opportunistic Locking on Windows 7 as well.

    Notes for Windows Vista

    The opportunistic locking registry keys are valid only for traditional SMB (SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was introduced in Windows Vista to enable faster communication between computer that are running Windows Vista and Windows Server 2008 or Windows Server 2008 R2.


    Shaon Shan| TechNet Subscriber Support in forum| If you have any feedback on our support, please contact tngfb@microsoft.com
    Wednesday, November 10, 2010 6:23 AM
  • Yes I have read it.  All I really want to do is prevent a user to be able to save to a file that someone else has open.  Could you explain to me how to set that up?
    notChrisKnight
    Friday, November 12, 2010 11:43 PM
  • Yes I have read it.  All I really want to do is prevent a user to be able to save to a file that someone else has open.  Could you explain to me how to set that up?
    notChrisKnight


    What you need is Source Control Software, that allows files to be checked in and out as being in use, maintain revisions, etc.  Being an Engineering firm i can't believe that two Engineers working on the same file (drawing???) making changes is really ideal.  The second attempt to open the file shouldn't be allowed if someone else has it open.  I can't image the issues that can cause internally in their processes should one engineer overwrite another's changes.

    You shouldn't rely on file server locking for this, you are doing an in justice to your clients if you are not recommending Source Control Software.

    http://en.wikipedia.org/wiki/Revision_control

    http://en.wikipedia.org/wiki/List_of_revision_control_software

     

    Saturday, November 13, 2010 2:40 AM
  • They do not want to use revision control.  That is what I recommended.

    Is there a way then to prevent a file from being opened once it is opened by another user?


    notChrisKnight
    Monday, November 15, 2010 7:52 PM
  • In the specific case where the files in question are local database files, such as from Foxpro, DBase, Xbase, etc., you can prevent shared access to the tables by specifying exclusive use when opening the tables in your application. For instance, in Foxpro, you can say "USE <tablename> EXCL". Alternatively, you can specify global exclusive use by issuing the statement "SET EXCLUSIVE ON" at the beginning of your app.
    Friday, April 15, 2011 6:49 PM