General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hello, Mark.
Thanks very much for the fun. I finally got a chance to run the code. Did you notice that it seems that only the index file that is being used exclusively? IOW, this only *works* if the cdx does not already exist.
So, the table in the first data session isn't getting reflagged as exclusively used. ISEXCLUSIVE remains .F.
So, this actually makes a lot of sense. To reindex, the .DBF (literally the file on disk) doesn't need to be locked. But of course the CDX disk file does. So in session 1 when you created the first index, you "created" the CDX and it got created with exclusive use.
Does that make sense?
>Nancy,
>If you're still interested, here is code which will re-create this effect. Notice that it is divided into segments, each to be run on a different session of VFP (2 VFP's loaded at once, on the same machine, defaulted to same path) in a certain sequence.
>
>*- Run this segment on Session #1:
>CREATE TABLE tblIndex FREE (cDummy C(10))
>APPE BLAN
>REPLACE cDummy WITH "Hello"
>USE
>
>SET EXCL OFF
>USE tblIndex && Table is opened SHARED.
>
>*- Now run this segment on Session #2:
>SET EXCL OFF
>USE tblIndex && Table is now opened twice.
>
>*- Now run this segment on Session #1:
>INDEX ON cDummy TAG cDummy && Creates tag even though opened shared & in use.
>
>*- Now run this segment on Session #2:
>BROWSE && This demonstrates that the table is still useable.
>USE
>USE tblIndex && Here's where you finally get an error.
>
>
>Have fun!
>Mark
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only