Solved

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

Posted on 2000-04-30
7
153 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 2

Author Comment

by:Roza
Comment Utility
What do you mean with "relocate record"?
0
 
LVL 1

Expert Comment

by:BlackDeath
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now