Ron Stevens wrote:

That solves the problem of two processes bootstrapping the database,
but is it possible for the second process to open the database while
the first is in the process of creating it (creating the header pages,
the system tables, etc) and view the database as corrupt since it
isn't fully created yet? I imagine there is at least a small window
between when the file is first created and when the file lock is
acquired on it, but I'm wondering how big that window is (or does it
not exist?).

Ron,

There is no window of opportunity for corruption. Before it can read a process must acquire a read lock on the database file. This will only be granted if no other process holds a write lock. A second process can open the database connection while the first is initializing the database, but because the first process is doing the initialization inside an exclusive transaction it will hold the write lock, and therefore the second process will get a BUSY error if it tries to read (or write) the database.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to