Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tableupdate fails?
Message
From
05/06/1998 21:28:45
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapore
 
 
To
05/06/1998 10:01:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00105114
Message ID:
00105434
Views:
38
>>My user reported that an invoice could not be saved after it was edited. My reprocess was automatic and when they pressed ESC, they got the error - record is unlocked. I found that tableupdate of a view was the culprit and solved the problem by doing FLOCK of both the updateable tables before executing tableupdate. (the view update 2 base tables)
>>
>>The invoice with the same set of data runs well on local machine.
>>
>>What happen? Doesn't tableupdate know how to lock the base tables properly?
>>
>>Begin transaction
>>if flock('table1') and flock('table2')
>> if !tableupdate(1,.f.,'invoice_view')
>> unlock in table1
>> unlock in table2
>> */* Error Handling
>> RETURN
>> else
>> end transaction
>> endif
>>endif
>
>Yes, tableupdate() knows how and where to lock. Using FLOCK() on table you provide high probability of locking conflicts.

Without FLOCK on the above codes, it will fail on some invoices. With the FLOCK, there is no problem.

I am getting my user to test to see if forced tableupdate(1,.T.,'xxx') helps or not.
Previous
Reply
Map
View

Click here to load this message in the networking platform