oplock problem

Claudia Moroder claudiamoroder at st-ulrich.suedtirol.net
Fri Nov 9 09:22:44 GMT 2001


the following message is a copy of a posting on comp.lang.clipper. Daniel
Treplin, the original poster, gave me the ok to post this to

To nderstand the problem better you can read all the postings of Daniel at


>we have a small Fax server here written in clipper which worked fine for
>years, but since we switched to SAMBA (instead of NT) and WIN2K on the
>Workstations (instead of Win98) we have corrupted .NSX index files
>on a daily base. I disableled opportinistic locking on SAMBA (2.0.6)
>as well as on Win2K (SP2) but the problem is still there. I also
>found a setup where I can reproduce an error which results in the
>truncation of a database file:

>When workstation 1 changes a record which was recently written
>by workstation 2 while workstation 2 is still adding additional
>records to this file, workstation 1 truncates the file after
>this record, all other new records are vanished.

>In case of the fax server, the program takes the first of the new
>records (which is a fax to send) locks it, replaces one value
>and gives a dbcommit(). At this point, the DBF file is truncated,
>the current record becomes the last one. This happens always when
>the record is changed while the other workstation is still adding
>new records, or within a few seconds after the first workstation

>The strange thing: this happen even when I let workstation 1
>read these new records before! I ran a COUNT() to count all new
>records in the file, which counted the right value!

>When I let both programs run on the same workstation (having the
>files on the same SAMBA server as before) the problem does NOT

>To me, tis seems to be a very stange effect of some caching or else,
>but since I disabled oplocks, and the data had been visible, I have
>no real idea what is going on.

>Suggestions would be welcome.


I tested this program too and got the same strange problems. Our Samba
server is 2.2.2.
Remember, that clipper uses a strange locking trick. It does not lock the
area it want to lock but  1 byte at a offset of 1GB ( im am not shure about
the right value ).

We have other clipper and paradox apps that worked well with 2.0.7, but have
index problems today.

I have the source of a small testing program Daniel wrote, but at the moment
not the binary ( I have at the office ), if necessary to make tests.


More information about the samba-technical mailing list