checking custom prop data integrity

George C Brackett gbrackett at luceatlux.com
Tue Jul 21 09:41:16 EDT 2009


Is the purpose of the online stack just to hold the value of the  
custom property?  If so, why not use a database such as MySQL or  
PostgreSQL?  These are carefully engineered to prevent collisions by  
multiple users.

George

On Jul 20, 2009, at 7:59 PM, Phil Davis wrote:

I'm looking for the best way to detect data corruption ASAP after it  
happens in a custom property of a stack. The stack resides on a file  
server and is read & written by many clients. File locking during  
reads and writes is already in place and seems to be doing its job,  
but occasionally we still have data corruption that creeps in.

Specifically, I want to make a way for the "Client B" app to know that  
the value it gets from the "uData" custom property of stack "myStack"  
is exactly what the "Client A" app put there a moment before.

Here's how I see this working:

   * Client A
         o (stack is in memory, file is locked on server)
         o sets the uData of stack "myStack" to new value
         o puts md5digest of updated uData into "dataDigest" file on  
server
         o saves "myStack" stack
         o deletes stack from memory
         o unlocks file on server
   * Client B (a moment later)
         o locks "myStack" file on server
         o puts "dataDigest" file from server into tOldDigest
         o goes to stack "myStack"
         o puts md5digest of uData custom prop into tNewDigest
         o if tNewDigest = tOldDigest, all is well; otherwise
           corruption exists

Does anyone see a problem with this approach? Is there a better way to  
accomplish the goal? If each client could check the data after its own  
write without having to read the stack into memory again to do so,  
that would be great - I just didn't see a way for that to happen.

Thanks everyone -
-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list