About flushing database cache to harddisk

About flushing database cache to harddisk

Post by Marz » Sun, 31 Dec 1899 09:00:00



Hi,

Question:
How can the BDE (AND WINDOWS!) be told to flush record buffers and harddisk
buffers?

Background info:
When posting a record to a Paradox table, the database updates are not
really done on the fysical DB files. Of coarse this is done to speed things
up.
But in this case I want to be absolutely sure that a posted record is really
on the harddisk, and not just floating in some cache in RAM. Also any index
file must be fully updated.

Why?
I'm using Crystal Reports 7 to print data from some Paradox tables.
But sometimes the CR print engine will crash down with some error in
Spool32.
This results in my application* also.
Only way out is CTRL-ALT-DEL and 'End Task' my app.
But by doing this I loose the last 10 (or so) posted records in the
database!

Temporary solution:
Until I find out what is happening in CR, I want to flush any buffered data
to the hard disk so that I don't loose data when CR crashes.

Any help greatly appreciated!

Thanks,

Marz

 
 
 

About flushing database cache to harddisk

Post by Sundial Service » Sun, 31 Dec 1899 09:00:00



> Hi,

> Question:
> How can the BDE (AND WINDOWS!) be told to flush record buffers and harddisk
> buffers?

> Background info:
> When posting a record to a Paradox table, the database updates are not
> really done on the fysical DB files. Of coarse this is done to speed things
> up.
> But in this case I want to be absolutely sure that a posted record is really
> on the harddisk, and not just floating in some cache in RAM. Also any index
> file must be fully updated.

> Why?
> I'm using Crystal Reports 7 to print data from some Paradox tables.
> But sometimes the CR print engine will crash down with some error in
> Spool32.
> This results in my application* also.
> Only way out is CTRL-ALT-DEL and 'End Task' my app.
> But by doing this I loose the last 10 (or so) posted records in the
> database!

> Temporary solution:
> Until I find out what is happening in CR, I want to flush any buffered data
> to the hard disk so that I don't loose data when CR crashes.

The "DbiUseIdleTime" API-call was used .. and I believe it still is used
.. to ensure that dirty buffer-pages are written to disk.  It is
designed to be called by an "Application.OnIdle" routine and by a
timer.

 
 
 

About flushing database cache to harddisk

Post by Henk Holterm » Sun, 31 Dec 1899 09:00:00


DbiUseIdleTime is 'obsolete' since BDE 4.

On the BDE samples page I found this snippet:

procedure TForm1.Table1AfterPost(DataSet: TDataSet);
begin
  Check(DbiSaveChanges(Table1.Handle));
end;

This will force changes in Table1 to be written to Disk.

-hh-

On Sun, 14 Feb 1999 12:53:53 -0700, Sundial Services



>> Hi,

>> Question:
>> How can the BDE (AND WINDOWS!) be told to flush record buffers and harddisk
>> buffers?

>> Background info:
>> When posting a record to a Paradox table, the database updates are not
>> really done on the fysical DB files. Of coarse this is done to speed things
>> up.
>> But in this case I want to be absolutely sure that a posted record is really
>> on the harddisk, and not just floating in some cache in RAM. Also any index
>> file must be fully updated.

>> Why?
>> I'm using Crystal Reports 7 to print data from some Paradox tables.
>> But sometimes the CR print engine will crash down with some error in
>> Spool32.
>> This results in my application* also.
>> Only way out is CTRL-ALT-DEL and 'End Task' my app.
>> But by doing this I loose the last 10 (or so) posted records in the
>> database!

>> Temporary solution:
>> Until I find out what is happening in CR, I want to flush any buffered data
>> to the hard disk so that I don't loose data when CR crashes.

>The "DbiUseIdleTime" API-call was used .. and I believe it still is used
>.. to ensure that dirty buffer-pages are written to disk.  It is
>designed to be called by an "Application.OnIdle" routine and by a
>timer.

-hh-
 
 
 

About flushing database cache to harddisk

Post by Anders Johansso » Sun, 31 Dec 1899 09:00:00


This question has been asked quite few times now and the answers
always (most of time at least) discuss the DbiUseIdleTime feature.
Why doesn't anyone mention the TBDEDataSet.FlushBuffers method?

Am I wrong in that this method will do the job or am I the first and
only one to use it?

Any comments anyone?

Anders Johansson
-------------------------------------------------------



> > Hi,

> > Question:
> > How can the BDE (AND WINDOWS!) be told to flush record buffers and harddisk
> > buffers?

> > Background info:
> > When posting a record to a Paradox table, the database updates are not
> > really done on the fysical DB files. Of coarse this is done to speed things
> > up.
> > But in this case I want to be absolutely sure that a posted record is really
> > on the harddisk, and not just floating in some cache in RAM. Also any index
> > file must be fully updated.

> > Why?
> > I'm using Crystal Reports 7 to print data from some Paradox tables.
> > But sometimes the CR print engine will crash down with some error in
> > Spool32.
> > This results in my application* also.
> > Only way out is CTRL-ALT-DEL and 'End Task' my app.
> > But by doing this I loose the last 10 (or so) posted records in the
> > database!

> > Temporary solution:
> > Until I find out what is happening in CR, I want to flush any buffered data
> > to the hard disk so that I don't loose data when CR crashes.

> The "DbiUseIdleTime" API-call was used .. and I believe it still is used
> .. to ensure that dirty buffer-pages are written to disk.  It is
> designed to be called by an "Application.OnIdle" routine and by a
> timer.

--
---------------------------
Anders Johansson
Hadelko AB
Kronobr?nneriet
302 42  Halmstad
Sweden
Tel +46 (0)35 102550
Fax +46 (0)35 187515

http://www.veryComputer.com/
---------------------------