>I am trying to avoid the "deadly embrace" syndrome with a shared network table. The documentation states that both APPEND BLANK and INSERT - SQL lock the table header and recommends using APPEND BLANK to avoid conflict, but I have thought that INSERT was the better method, however yesterday we had that dreaded conflict.
>
>What are the recommended procedures for multiple users adding records to the same shared table, i.e., SET REPROCESS, and APPEND BLANK vs. INSERT - SQL? In some cases a procedure may add numerous records over a short period.
>
>BTW I am using private datasessions in my forms and the application is in VFP 5.
You may get several different methods on this. I do all of this in a function/method which has a lot of code for checking status, error, etc., but what I generally do is to SET REPROCESS TO 1, set buffering to table buffering, use INSERT-SQL to add a record, then execute TABLEUPDATE() with the appropriate parameters for the situation and test the return value for success/failure. If success, we're good to go. If failure, check error codes to try to determine why. Depending on that, try again, and/or notify user of update conflict, etc. I usually put it in a loop which will try to update a certain number of times before just bailing out and TABLEREVERTing. Other may have more sophisticated methods.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.