Solved

How to save all data to disk after posting a record to Table?

Posted on 2000-04-30
7
157 Views
Last Modified: 2010-04-04
I don't know how to force TTable to write data to disk.
It happens only on very slow machines (ex:486 40 with 8mb ram)

I use TTable and TDataSource. When in my program user adds records to table it can normaly work with them, but if program crashes (or cycles: i:=10 while i<10 do i:=10;) or if computer runs out of power that data does not save to disk. How force to save all data to disk after posting a record? On fast machines all data are updated on-time. And if i crash everything is saved.

Should I use CachedUpdates or...?
I would appreciate example. Thanx.
0
Comment
Question by:Roza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2763651
hi roza,

use the ttables flushbuffers method after each post,
to force the bde to write the data to disk,
the only problem is then the os-cache,
which may cache the writing attempts temporary.

meikl
0
 
LVL 2

Author Comment

by:Roza
ID: 2763669
I used FlushBuffers method, but it does not help.

OS cache-possible, but why on computers with very low memory.

It is stupid to tell user. If you want to be sure that your data will actualy be saved, you should restart my program ;)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 2763736
well, thats true,

another possibility may to close and
reopen the table and relocate the record after each post,
but this will slow down your performance.

meikl
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:Roza
ID: 2764277
What do you mean with "relocate record"?
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 2768483
hi roza, hi meikl.

you can deactivate the os cache.
in win95 it's

(hm. i've got a german version so i don't know the english terms... in german it's as follows)

systemsteuerung-
system-
leistungsmerkmale-
dateisystem-
fehlerbehebung-
verzögertes schreiben für alle laufwerke deaktivieren

in english it 's kinda:

control panel-
system-
?- [fourth tab]
file system (?)-
?- [third tab]
deactivate cached updates for all drives (?)

and there's a possibility for similar settings in windows nt and windows 2000, too.

BlackDeath.
0
 
LVL 2

Author Comment

by:Roza
ID: 2771236
Hi BlackDeath

Thanx for a hint.

Meikl's iddea about closing and reopening table works quite fine. Good side is that it does not affect on other programs..

I will keep this question open for a few days if somebody finds some other idea.. otherwise I'll be satisfied with simple (not very nice), but workable idea ;)

BTW: my cycle in questin is not actualy a cycle ;) I guess you understand what i meant (endless loop:  i:=10;  while i=10 do i:=10)

Roza
0
 
LVL 2

Author Comment

by:Roza
ID: 2785477
That sollution works and it does not affect on other programs (with changing system cacheing you would affect)

If anybody finds some other sollution.. I will be happy and give points for some faster sollution.

Best wishes from Roza!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Spellcheck in Webbrowser 1 51
Delphi selector screen 2 92
Delphi and Access based Enumeration 9 78
shape, triangle, dbctrlgrid 3 33
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question