Re: Cobol .DAT backup solution




William M. Klein wrote:

A) have a separate "backup" job that runs when you want it to (say once a day)
This program should LOCK the file so that no one else can update it (but could -
possibly - read it).

But it cannot obtain an exclusive (file) lock if any other process has
the file open in shared mode. It may be that the running programs don't
close the file frequently enough to ever let an exclusive lock mode
open the file.

It is necessary to have a global 'update flag' - a file that contains
switches that every program must check before doing anything that would
lead to a file update. To be safe it must also set its own switch in
the file before it starts an update and sets it off again after
completing. The backup program must wait until all the switches are off
to ensure that no more change to the file will occur.

With a reasonable system I would use a file with a control record that
must be checked before any update can be done. Each process would have
its own record that it would lock before checking the switch until it
completed updating or quit because the backup switch was on.

If a process crashed or otherwise disappeared I would expect the OS to
clear the lock, but my experience is that Windows won't do this
reliably.

This does require a system that is designed from the start to cater for
in flight backups, it is difficult to re-engineer to add it afterwards.
Same with avoiding deadlocks. A few simple rules and you will never
get a deadlock, no rules and it is a monster to add avoidance later.

.



Relevant Pages

  • Re: 74 Archer ignition switch question
    ... News flash...I removed and disassembled the switch as suggested. ... fragments laying on the rag. ... the outer corner of the trough the lock tumblers locked into was eroded. ... Wag also has new units (push to start and the other kind). ...
    (rec.aviation.owning)
  • Re: 240D lights problem
    ... no center lock either. ... Installing the switch was very easy but I now have trouble with the locks. ... I put the steering lock back into its holder and the ... What is different in the three is what appears in the middle of the pins and the metal casing around the outside. ...
    (alt.auto.mercedes)
  • Re: TECH: The Shadow lock and switch problems
    ... Now when playing a game the opto ... catching the ball at the Sanctum lock (Wall ... sucked into the lock it simply rolls down the playfield, ... before the error occurs I am not getting the double switch hit. ...
    (rec.games.pinball)
  • TECH: The Shadow lock and switch problems
    ... Now when playing a game the opto ... catching the ball at the Sanctum lock (Wall ... sucked into the lock it simply rolls down the playfield, ... before the error occurs I am not getting the double switch hit. ...
    (rec.games.pinball)
  • Re: An E28 wiring question.
    ... they reverse polarity to make the lock go in the opposite direction. ... The locks have a switch on them that tell the central locking system ... the lock solenoid are going to be the power that tells the solenoid ... But my intention is to use the switch circuits. ...
    (alt.autos.bmw)