Subject Re: [ib-support] When do FB/IB 'flush' to disk?
Author Paul Schmidt
On 4 Dec 2001, at 1:25, Phil Shrimpton wrote:

> On Monday 03 December 2001 21:25, you wrote:
>
> Hi,
>
> > I've just done some research on MSDN's website and found a function
> > that flushes a file from memory to disk. The function is
> > "FlushFileBuffers".
>
> That will do the trick.
>
> The questions are...
>
> Would this be easy to implement in Firebird (for those of us that are
> C impaired), and if so when should it call it, and how often.
>
> The two options that come to my mind are "Every Nth Commit" or "Every
> Nth Second"
>

It would make sense to have this every commit, then Windows
engine users know that they can balance run time, against data
loss, and isn't this the idea behind the commit in the first place?
By allowing more time between commits, you decrease execution
time, but increase the risk of data loss. By decreasing time
between commits, you increase execution time, but decrease risk.

Now as for the C code, it depends on whether they use Windows
style file handling, or whether they use ANSI style file handling, in
either case there is a function to handle it, in ANSI file handling
there is the fflush() function, in Windows file handling there is
FlushFileBuffers, so the question becomes where do you put it,
somewhere in the commit code, make the most sense. It then is
up to the application developer to make sure that code that sits idle
commits it's data. For example if you have a user entering data,
and they leave for the weekend, you really don't want the OAT
being that old anyway.

Paul




Paul
Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com