Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Conflicts -- Real or Imagined...
Message
From
28/07/2004 11:55:18
 
 
To
28/07/2004 11:45:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00928743
Message ID:
00928755
Views:
25
Hilmar,

Yes, I use buffering, Optimistic Record Buffering.

I use the EDIT button, because the application requires security on different fields.

It is rare that two different people will EDIT a record. But it is not rare that two people will look at the same record, or one person EDIT and the other person VIEW the same record.

The problem is that who ever moves the record pointer last leaves the record as they saw it.

Thanx,

Mike


>Do you use buffering?
>
>With optimistic buffering, records will not be locked when the user looks at a record, or even when the user edits; only when the user tries to save will VFP check for conflicts.
>
>You don't even need an "Edit" button; the user can start editing at any time.
>
>OTOH, it should seldom happen that users actually edit the same record at the same time (except for processes that handle multiple records). If it does happen quite often, it may be an indication that you may to do some redesign. For instance, non-normalized tables might cause problems.
>
>>I have a database application that is used by alot of people. Upto a while ago, I had no problems... However, I gained even more users(about 100) and then my troubles began... My users started to receive Update Conflict errors, as more and more users started to look at the same records.
>>
>>When a user pulls up a record, all controls on the screen are readonly. Only if the user clicks on the edit button will the controls allow editing.
>>
>>After all of these Update Conflict errors, I appended this code at the bottom of my SAVE code:
>>
>>FOR a = 1 TO FCOUNT('wrs')
>> IF CURVAL(FIELD(a)) <> OLDVAL(FIELD(a))
>> *-- someone has updated a field...
>> cReturnString = cReturnString + FIELD(a) + " Changed from " + ;
>> OLDVAL(FIELD (a)) + " to " + CURVAL(FIELD(a)) + CHR(13) + CHR(10)
>> lchanges = .T.
>> replace (FIELD(a)) WITH (CURVAL(FIELD(a)))
>> ENDIF
>>ENDFOR
>>
>>This got rid of all the Update Conflict errors. However, If two people sit on a record. And the first does an EDIT and SAVE, and the second person never does an edit; after the first person has moved on, then the second person moves on... The second person reverts the record back prior to the first persons' edits.
>>
>>How do I stop this?
>>
>>Thanx,
>>
>>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform