Update_Index() contention (OpenInsight 32-Bit)
At 15 OCT 2008 11:41:14PM Matthew Crozier wrote:
Say I call update_index( file, index, 0) while that index is being updated on another workstation:
- Will update_index() wait until that workstation has done the update before returning, or will it just return immediately because someone else is doing the job?
- How can I tell if an index is being updated elsewhere (ie, what lock is in place - 'index', 'index*', 'index*ROOT')? I've tried locking all three but update_index() just seems to come straight back with no indication whether the index update was completed.
Cheers, M@
[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]
At 16 OCT 2008 06:20PM Bob Carten wrote:
Update_index calls index.flush calls F.distributor.
for each indexed table
F.distributor tries to lock the '*INDEXING' record
If it cannot get the lock it skips to the next file
There is no record of skipped files.
By coincidence I was working on a post about an indexing service. see this post
You could modify the program I posted to walk through the indexes one at a time, perhaps record the length of the 0 record before and after each update.
- Bob
At 17 OCT 2008 01:09AM Matthew Crozier wrote:
Thanks Bob,
F.distributor tries to lock the '*INDEXING' record
Gosh, that sounds like old code ;). Does that mean there is only a generic lock when any index on a file is updated - no specific lock for a given index?
So if one machine tries to update a specific index while another machine is updating a different index in the same file, it will fail because it will just drop out?! If so, is there any way to check or ensure that an index gets updated when update_index() is called?
Thanks for the Indexing Service code - very useful :).
Cheers, M@
[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]