Richard,

On Jan 21, 2011, at 5:41 PM, Richard Hipp wrote:

> On Fri, Jan 21, 2011 at 8:27 PM, James Berry <ja...@jberry.us> wrote:
> 
>>       (1) Is there any API I can/should use to predictably get the name of
>> the journal file so that I can delete it, without "knowing" what is should
>> be?
>> 
> 
> The name of the journal is always the name of the original database file
> with either "-journal" or "-wal" appended.  Delete those two files when you
> delete the original database and you are always safe.  To change the journal
> filenames in any way would result in an incompatible file format, since it
> would mean that newer versions of SQLite would not be able to recover from
> crashes on older versions of SQLite.  We work really, really hard to avoid
> incompatibilities, so you may safely assume that the journal filenames will
> remain unchanged.
> 
> 
>> 
>>       (2) Are there any changes that can/should be made to sqlite3 so that
>> it can identify the bogus journal in this scenario and discard it?
>> 
> 
> We've thought about that before, but never could come up with a reasonable
> suggestion.
> 
> 
>> 
>>       (3) Should there be a flag to open_v2, or something, that tells it
>> to discard any extant journal?
>> 
> 
> Having that option on open_v2() would just confuse people into actually
> using it, which means they would more often end up deleting hot journal
> files that they really needed for crash recovery.  Such a flag would result
> in far more problems that it solves, I believe.

I see your point here. What if there were a separate api that I could hand a 
file to,
prior to calling open, that would cleanse the file. Though I can look for 
-journal
and -wal today, I don't know to look for -wbl and -swirl tomorrow.

Granted, if you add sqlite_cleanse(dbPath) you might have as many people
calling that as you would have using a new flag to open_v2.

Thanks for a piece of software I marvel at (nearly every day ;)

James




> 
> 
>> 
>> Thanks,
>> 
>> James
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
> 
> 
> 
> -- 
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to