Ron Stevens wrote:

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?

Ron,

No, you have to do that in your application.

In pseudo code your create function could do this:

   open the database file
begin an exclusive transaction (since you may need to write to initialize the tables)
   read the user_version
   if the user version is not zero
create the tables (read SQL script into a string and pass the string to sqlite3_exec)
      set the user version to a non zero value
   endif
   commit the transaction

Only one process will succeed in getting the write lock while opening the transaction. That process will create the tables and set the user_version so no other process will try to reinitialize the tables latter.

HTH
Dennis Cote

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

Reply via email to