Subject Re: [firebird-support] Embedded server database easily corrupted
Author Lester Caine
Da Jiao wrote:

>>Having had fun in the past with power out problems, even
>>before switching to Interbase, I can say it is not an easy
>>problem to solve in software. Some sort of UPS is a must to
>>ensure that power-outs can be managed.
> But this application is a small one running on ordinary customers' desktops.
> Cannot force them to use UPS.

Always a problem area, which is why I always save the
important data on a separate network machine. You never know
what an 'ordinary customer' will do on theirs.

>>You do not say, but for windows we had great fun at one time
>>when a whole days work could be lost, simply because the OS
>>was caching the information and totally ignoring the flush
>>to disk!
> IB or FB?

This predates my use of IB. Early 1990's we were running
dBase and Codebase. It took a year, but we got the desktop
software to the point that you could unplug the machine,
plug it in again, and carry on (W3.1 and W98SE). WINDOWS
2k/XP fails that test today, which is the first problem!

>>Things are a little better now, but since vital information
>>may well be held in RAM, and not get copied to disk
>>corruption's are difficult to avoid if you simply switch of
>>the power.
>>There are a few cache settings that will make things better,
> What are them, please give details.

The obvious one is 'Forced Writes' ON in the database. (
That is one that the earlier Windows caching used to ignore :) )

Make sure windows is set 'Optimized for Background
Services', that way the 'server threads' will be completed
faster. ( Anyone - Does that apply with embedded - it does
affect SuperServer I believe )

Switch any 'Write Cache' off on the disk drive or disk
server ( Hardware settings - this will ensure that essential
pages are not sitting in the hardware cache when the power
goes out )

As I say, it has been a while since I've worried about any
of this. My customers tend to accept that the starting point
is a UPS now.

Lester Caine
L.S.Caine Electronic Services