Subject Re: [firebird-support] Can overwrite database file while open - FB 2.5
Author Michael Ludwig
technisoft2005 schrieb am 07.12.2010 um 08:05 (-0000):
> Windows 7 Pro (64-bit), FB 2.5.0.26074_1_Win32 (installed as
> SuperClassic), DB access via an alias
>
> I have a database, files\DATA.FDB
> I make a copy of the database in a subfolder files\sf1\DATA.FDB
> I have a different database with the same name in files\sf2\DATA.FDB
>
> I open a program module and access DATA.FDB displaying data on the
> screen. I leave the module as it is.
>
> I use the Windows explorer to copy the file from sf1\DATA.FDB into the
> files folder, even though files\DATA.FDB is open it succeeds.

Okay, you're clobbering your database.

> The explorer progress bar gives me this feedback. I can continue
> working in the DB, no immediate problem as the 2 files are identical.

Guess you're lucky. :-)

> I use the Windows explorer to copy the file from sf2\DATA.FDB into the
> files folder, even though files\DATA.FDB is open it succeeds.

You're clobbering it again. :-)

> I may be able to move from one record to another for a while, until FB
> has to get new records into the cache (I suspect). Exception at this
> point, End of File reached. (Note 1) Staying in the program I copy
> sf1\DATA.FDB over the DB in use, and I can continue working.

And again. :-)

> Note 1: If I click on a refresh button which restarts the program's
> transaction the program (not FB) crashes altogether, as I would expect
> at this point.

There certainly are limits to any given software's resilience.

> Shouldn't FB lock a DB in use?

I lock the door when leaving the house but that's unlikely to impress a
meteor intent on making an impact on its roof.

--
Michael Ludwig