Solved

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

Posted on 2000-04-30
7
154 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

27 Experts available now in Live!

Get 1:1 Help Now