Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data corruption - Free tables and DBC

Status
Not open for further replies.

phita

Programmer
Jun 8, 2001
82
KE
Hi,
I have recently switched from Foxpro 2.6 to Visual Foxpro 6.0. Foxpro is notorious for it data corruption whenever power goes off while some data manipulation is going on. However, I read that DBCs can be of some help. Please explain to me whether the tables are more stable while in a DBC or there is no difference whether the table is a free table or in a DBC.

Is there anything I can do to make the tables more stable ? Or do I have to use another database server e.g. SQL or Access ?
 
The simple rule I follow is
1. Always FLUSH after a write to harddisk.. This can be update/edit/append/rewrite/write whatever..
2. With VFP6 onwards, I use BEGIN TRASACTION.. END TRANSACTION.. which puts the situation back yo square A if the END TRANSACTION is not reached. So to avoid a harddisk cache holding the data, use the FLUSH before the end transaction is reached.
3. ALL DATABASES are subject to corruption, but with the above ensured, to br frank, my DataBase corruption is almost NIL. :)
4. I have a versatile and robust class to handle only write/update and the entire application uses the single function being used for writing. SO I am planning even mirroring by setting a parameter and use a different physical device to duplicate for fail safe operations, if the user client needs such a facility. Since a single class is initiating the whole operation, mirroring based on a parameter, will be so easy and just a while away. Only matter is how I am going to interface .. so that when a failure is detected, reset from the duplicate has to be done..etc. is in the drawing board..

Hope the ideas/views are of help to you. ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
One other suggestion. If you are actually in a location where you have that type of power problems, why do you not have UPS's on all your machines, servers and network components.
 
For the record, it's not really FoxPro, but rather:

a) The design structure of .DBF's - blame Aston-Tate.

b) DOS / MS Operating systems that "help" applications out by providing write behind caching so that when you say "write", it just goes to a memory buffer and eventually gets witten to disk.

c) People who don't spent the small amount of money required to buy a UPS that can "fix" the first two limitations which cause the majority of the problems.

d) People who allow users the ability to manually power off the logical file server, which causes most of the rest of the problems.

(Now getting off soap box - sorry about that.)

Rick
 
Thanx guys for your advice. I will try to implement your ideas.

Thanx,

Phita.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top