To bootstrap my db's I create a database template. Then make a physical copy of 
that. Locking and access is done via flock. So the first process to gain the 
lock wins and is respoonsible for making the copy, the other just waits until 
the lock is released and then  connects.
 
 I make lots of databases and found that creating a template then copying is 
much faster than using the sqlite api to create the db, then to create the 
individual tables.
 
 

Ron Stevens <[EMAIL PROTECTED]> wrote: I have two processes trying to access a 
database for the first time at
roughly the same time. I'm wondering if it's possible to atomically
create a database and bootstrap it with some tables from one process
so that the other process doesn't open the database either before
SQLite has finished writing the system tables or the first process has
finished the application specific bootstrapping.

In general, does SQLite protect against the database being opened
while it's being created so other processes don't open it assuming
everything is in a good state?

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


Reply via email to