Sharing violations -- wondering... 
Author Message
 Sharing violations -- wondering...

Using C4b Legacy and a little confused...

I have a process that Adds records to another file. (Originally, the file
was user-specific and I didn't need to be concerned about this.  Now there
is a possibility of a sharing violation.)

To do the auto-increment, I had used the following:

Set(File)
Previous(file)
NewRecordNo=Fil:Auto + 1
Add(File)

Since another user could (now) be Adding a record at the same time and the
system will autoincrement to the same number that is being added in the
above, what is the best method for handling this?

Would it suffice to add error checking - that if this is a duplicate
number - the above code is attempted again?  Hold/Release? Logout/Commit?

TIA,

JA



Fri, 27 Sep 2002 03:00:00 GMT  
 Sharing violations -- wondering...

Quote:
>To do the auto-increment, I had used the following:

>Set(File)
>Previous(file)
>NewRecordNo=Fil:Auto + 1
>Add(File)

1.  Let Clarion handle the AutoInc. bye itself.

2.  When starting the insert Clarion will infact add a empty record
    to the file. This will ensure that others adding records WILL get
    a unique value. The only problem is that if the user break off the
    insert there will be a 'hole' in the serie of numbers.1  

Kjetil Nesheim
More Computers



Sat, 28 Sep 2002 03:00:00 GMT  
 Sharing violations -- wondering...
James,

I used to worry about this as well but in practice it doesn't seem to be
much of a problem.  There _IS_ a slight chance that if two users timed
it "just right" (between the PREVIOUS and the ADD) they could end up
with duplicate "NewRecordNo".  In my "real world" however, I've not seen
this happen in many years of Clarion usage.  

On the other hand, you can also put "IF DUPLICATE" logic in there and
keep trying until you found a NewRecordNo that works.  As a "lazy
paranoid", I used to do this in my hand code but quit some time ago -
too much trouble and I've not been burned because of it <grin>.

Al



Sat, 28 Sep 2002 03:00:00 GMT  
 Sharing violations -- wondering...
Thanks for the tip.  I will try to be less paranoid <g>.

Quote:
> I used to worry about this as well but in practice it doesn't seem to be
> much of a problem.

JA


Sat, 28 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Sharing violation Error code #5

2. ShellExecute() returns 5 (Sharing violation)

3. SHARING VIOLATION on EXE

4. Sharing violation on exe

5. File Sharing Violations re: Workgroups Workstation to NT Server

6. Share Violations on NT

7. NT Server sharing violation- exe & ovl files

8. File Sharing violation LPT1.PRN

9. SHARING Violation

10. Re DOS error 32 - Sharing violation

11. Win 95B Sharing Violation problem

12. VO 2.0 / Clipper - Sharing Violations

 

 
Powered by phpBB® Forum Software