Board index » delphi » Turning off caching ????

Turning off caching ????

 I have written a database app to allow mutiple users edit the database
at the same time. It is a non paradox program using FileOpen, BlockRead,

BlockWrite etc.

I?have implemented my own record locking routines which do not allow
editing of the same record by two users at the same time. This works
fine.

My problem however is that if one user makes a change to a record some
users do not see the change. I know for certain that the change is
written to disk because I flush the file after every write. But it seems

that the other users computers have cached the file and do not see the
change. How do I disable this caching so that every computer recognises
the change made to the database ???

Thanks in advance !!!

Gary Marjoram

 

Re:Turning off caching ????


In article <33572D1C....@iol.ie>,
   Gary Marjoram <polyd...@iol.ie> wrote:

Quote
> I have written a database app to allow mutiple users edit the database
>at the same time. It is a non paradox program using FileOpen, BlockRead,

>BlockWrite etc.

>I?have implemented my own record locking routines which do not allow
>editing of the same record by two users at the same time. This works
>fine.

>My problem however is that if one user makes a change to a record some
>users do not see the change. I know for certain that the change is
>written to disk because I flush the file after every write. But it seems

>that the other users computers have cached the file and do not see the
>change. How do I disable this caching so that every computer recognises
>the change made to the database ???

Have you got any kind of control on the caching mechanism? Have you
implemented the caching or you use a kind of multi-user OS?

If you have control on the caching system, the solution is simple:
just inform all users about the record that changed, so that it is
"uncached" (the "cached" bit for this record or area is cleared).

If you rely on the caching system of a multi-user OS, then the
solution must be found for the specific OS. It must provide a
routine (interrupt, DLL function ...) for this purpose. In the
worst case you should inform all users that the file is changed,
so that ALL the records are "uncached" (try to avoid the last
solution, if at all possible). If no other alternative is usable,
the last resort would be that each user closes and reopens the
file (very-very bad...).

Hope this helps

Quote
>Thanks in advance !!!

You are welcome

Babis Athineos

--
E-mail: ba...@hol.gr
WWW : http://users.hol.gr/~babis
Snail-mail: Papadoniou 61, 11145 Athens, Greece

Other Threads