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
Solved

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

Posted on 2000-04-30
7
156 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
  • 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 68
Delphi Form ownership 4 113
find a node in VST 2 73
How to insert .png images to TClientDataSet .cds file? 2 32
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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