Re: FLUSH [was: Mixed language programming Tcl/Tk and Fortran (Windows)]

From: James Giles (jamesgiles_at_worldnet.att.net)
Date: 10/02/03


Date: Thu, 02 Oct 2003 18:51:37 GMT

Jan C. Vorbrüggen wrote:
>>> As for doing this automatically (your question to Ron), I don't see how
>>> this can be done in a general way.
>>
>> Then you haven't read the thread.
>
> Why do you elect to be needlessly insulting whenever the slightest
> opportunity arises?

If you insist on taking offence, that's your choice. I was pointing out
that the correctness of flush after every WRITE has already been
established (and accepted) as being obviously correct (in the sense
of never omitting a flush that's needed). Flush after every WRITE
can obviously be automated. And it's completely general.

>> In his case, it's trivially obvious
>> that automatically flushing after all WRITEs is sufficient.
>
> Yes, after all WRITEs that belong to one transaction. How does your
> run-time system determine where one transaction ends, and the next one
> begins?

*EVERY* WRITE is a transaction. It is a transaction between the
program and the system (with the I/O library as an intermediary).
A flush after *every* WRITE is sufficient to guarantee correctness.
It isn't necessary, but it's sufficient.

-- 
J. Giles


Relevant Pages

  • Re: dbf trashing problem after upgrade
    ... i will do some testing with the commands you mentioned and let you know of ... > Hi Anis ... > FLUSH doesn't work on disks that have an active Write cache, ... > data modifications or as the BEGIN TRANSACTION - END TRANSACTION / ...
    (microsoft.public.fox.programmer.exchange)
  • Re: dbf trashing problem after upgrade
    ... FLUSH doesn't work on disks that have an active Write cache, ... Tha'ts why VFP in recent versions has added commands like SYS'Purge ... data modifications or as the BEGIN TRANSACTION - END TRANSACTION / ROLLBACK ... the terminals share a DBF on the server. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: computational model of transactions
    ... You obviously see a difference between modification and replacement. ... It is only necessary to obtain an exclusive lock on the affected row at the time that the update to the shared resource occurs, so it's possible to have several other intervening transactions commit between the time that the transaction starts and the time that the update starts. ... Database engines can provide concurrency and consistency, not correctness, so in a replacement, the assumption is that the new value is correct, and it's up to the application to correctly calculate the new value; whereas with modification, the new value is calculated by the database engine. ... UPDATE Inventory ...
    (comp.databases.theory)
  • Re: computational model of transactions
    ... It is only necessary to obtain an exclusive lock on the affected row at the time that the update to the shared resource occurs, so it's possible to have several other intervening transactions commit between the time that the transaction starts and the time that the update starts. ... Modification depends on the current state of the attribute; whereas replacement doesn't. ... Database engines can provide concurrency and consistency, not correctness, so in a replacement, the assumption is that the new value is correct, and it's up to the application to correctly calculate the new value; whereas with modification, the new value is calculated by the database engine. ...
    (comp.databases.theory)
  • Re: computational model of transactions
    ... It is only necessary to obtain an exclusive lock on the affected row at the time that the update to the shared resource occurs, so it's possible to have several other intervening transactions commit between the time that the transaction starts and the time that the update starts. ... Modification depends on the current state of the attribute; whereas replacement doesn't. ... Database engines can provide concurrency and consistency, not correctness, so in a replacement, the assumption is that the new value is correct, and it's up to the application to correctly calculate the new value; whereas with modification, the new value is calculated by the database engine. ...
    (comp.databases.theory)