FW: Record locking

Bill Vermillion fp at wjv.com
Thu Apr 1 06:51:47 PST 2004


On Thu, Apr 01, 2004 at 01:13:34AM -0500, John Esak thus spoke:
> I'll post this for you... it is interesting...
> John Esak

> -----Original Message-----
> From: ken white [mailto:kenwhite at arcticinfotech.com]
> Sent: Wednesday, March 31, 2004 2:57 PM
> To: John Esak
> Subject: Re: Record locking

> John I cannot seem to post to the filepro news group so I sent my response
> to you.

> ----- Original Message -----
> From: "John Esak" <john at valar.com>
> To: "filePro mailing list" <filepro-list at seaslug.org>
> Sent: Wednesday, March 31, 2004 12:34 PM
> Subject: RE: Record locking
> 
> > > As drives and computers get faster, timing problems are
> > > bound to happen especially with windows based systems.
> > >

> >  So when people talk about even more strange things like
> > write caching of one kind or another and faster networks and
> > etc.... it all makes no difference if the record is locked
> > properly and filePro certain does _its_ part of the job in
> > this regard. Otherwise, we all need to see such misbehaving
> > code. As you say, your problem is most likely outside of
> > filePro.

> I do know if this is an the issue with filepro under windows,

> XP / NT / 2000  - OpLocks

> I have run into database corruption on other databases if
> OpLocks is turned on ( enabled ) when using the above OS's.

> The following registry key controls Oplocks.

> Server Side (2000/XP)

> HKLM/system/currentcontrolset/services/lanmanserver/Parameters/EnableOplocks

> Client Side:

> HKLM/system/currentcontrolset/services/MRXSmb/parameters/OpLocksDisabled

OpLocks is the short name for opportunisic locks.  

Here is some edited material on OpLocks, and you can see why these
really shouldn't be on for most computer applications.

My comments will be preceded by ****
========================================

Opportunistic Locks

   An opportunistic lock (also called an oplock) is a lock placed by a
   client on a file residing on a server. In most cases, a client
   requests an opportunistic lock so it can cache data locally, thus
   reducing network traffic and improving apparent response time.
   Opportunistic locks are used by network redirectors on clients with
   remote servers, as well as by client applications on local servers.

*** Note that the reason is to improve network performance and
*** reduce network traffic.  Now that 100Mb & switches are the norm
*** and 1GB is advancing rapidly and 10GB is coming shortly, those
*** arguments made more sense in 10Mbit networks with >hubs<.

   Opportunistic locks coordinate data caching and coherency between
   clients and servers and among multiple clients. Data that is coherent
   is data that is the same across the network. In other words, if data
   is coherent, data on the server and all the clients is synchronized.

   Opportunistic locks are not commands by the client to the server. They
   are requests from the client to the server. From the point of view of
   the client, they are opportunistic. In other words, the server grants
   such locks whenever other factors make the locks possible.

*** And this basically says it may lock things if it can get 
*** around to it.  Not something you want for database integrity.

....

   Local applications should not attempt to request opportunistic locks
   from remote servers. An error will be returned by DeviceIoControl if
   an attempt is made to do this.

   Opportunistic locks are of very limited use for applications.
   The only practical use is to test a network redirector or a
   server opportunistic lock handler.

*** for me that says "Danger Will Robinson".

...

   Opportunistic locks and the associated operations are a superset of
   the opportunistic lock portion of the Common Internet File System
   (CIFS) protocol, an Internet Draft. The CIFS protocol is an enhanced
   version of the Server Message Block (SMB) protocol. For more
   information on the CIFS protocol, see Microsoft SMB Protocol and CIFS
   Protocol Overview. Note that the CIFS Internet Draft explicitly
   provides that a CIFS implementation may implement opportunistic locks
   by refusing to grant them.

*** Note that last line where it may implement them by refusing to
*** grant them.  IMO it's just another MS idea that went the wrong
*** for the wrong reasons.

========================================

The above is from the Miscrosoft library.

Bill
-- 
Bill Vermillion - bv @ wjv . com


More information about the Filepro-list mailing list