How To Prevent Multible Users Of Application From Clobbering Each Other

  • Thread starter Thread starter Christopher Lusardi
  • Start date Start date
C

Christopher Lusardi

How can I prevent multible people, who use my program at the exact same
time, from overwritting textfiles? E.G.: Two users start the same
program and one deletes something but the other saves his data and
undoes the delete that was done!

Also, what about databases being overwritten at the same time. How can
I prevent users from interfering with each other?

Thank you,
Christopher Lusardi
 
Chrisopher,

Normally with a normal open for write you cannot overwrite a text.file.
However some classes overwrite automaticly as by instance the ds.XMLWrite
Therefore just testing is always the best.

However the File class gives you a lot of information.
By instance the File.exist(path)

For databases the word for this is concurrency, if you check for that on
Interenet you get a lot of information.

http://msdn.microsoft.com/library/d...skPerformingOptimisticConcurrencyChecking.asp

I hope this helps,

Cor
 
Back
Top