>Anyway, why would you want the ability to do these things without an exculsive lock? Man, the potential train wreck from a structural change without exclusive is scary to think about.
I don't think it is impossible. How about an exclusive hold that can be forced for a split second?
1) Set a database container property indicating the change to take place.
2) Set Database container flag indicating that there is a pending request to change the database.
3) Database finishes current table write then forces exclusive hold to the table. To the other clients this would appear as if all records in the table were locked.
4) Perform the queued structure change request
5) Release the exclusive hold on the table. Database operations then continue as normal.
This would all happen in a split second. The user may see a "wait for a lock" message for a spit second or however you have coded this.
These would be easy
- changing field size
- adding a field
- adding a table
Medium
- removing a field
Hard
- changing the type of a field.
Okay for reindexing. The system would start as above, then...
1) Copy the table. Then keep a list of all data changes
2) Reindex the copied table
3) Force an exclusive hold (this be as above)
4) Insert recorded changes into table and index
5) Release exclusive hold
Once again the lock would only be for a split second and appear to the other clients as if every record in the table was locked.
Ability to keep a VFP database up for 24/7 all year would be a great feature for the product. Of course I could code and app to do this and it would only open tables when it needed to write, delete or change data, but thing of all the overhead.
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