Also note that it's often possible to open a corrupted database and
operate on it with no error, nothing goes bad until you touch a
corrupted row/table/index.  We've found that doing a "PRAGMA
integrity_check" is effective for discovering any/all corruption in a
database early and avoiding random errors later.  Make sure you do this
after blowing away your -journal file while you're experimenting.

                                        --Bob 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan
Sent: Tuesday, June 03, 2008 7:50 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] transaction recovery question


On Jun 3, 2008, at 10:03 PM, Darko Filipovic wrote:

> I've tried...(not with UFO :D ). Nothing happens, database is not 
> corrupted and that is what confuses me...I thought it should not be 
> readable (malformed) ?!

When SQLite needs to modify the content of a database page, it does two
things:

   * writes the contents of that page out to the journal (so that it
     can be rolled back later if necessary), and
   * makes the change to an in-memory copy of the page.

Later on, when the transaction is committed or enough changes have
accumulated in memory, all pending changes are flushed through to the
file. You probably abandoned the transaction to early for this to happen
- so the journal file was in the file-system, but no actual changes had
been made to the database file.

Try it with a really big transaction and you will see the corruption.

Dan.






> Greetings,
> Darko F.
>
>
>
> Federico Granata wrote:
>> 2008/6/3 Darko Filipovic <[EMAIL PROTECTED]>:
>>
>>
>>> But, what happen if journal file is deleted before starting B 
>>> process?
>>>
>>>
>> what if a UFO stole your pc ? :-D
>>
>> try to delete journal file and see what happens ...
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> __________ NOD32 3154 (20080603) Information __________
>>
>> This message was checked by NOD32 antivirus system.
>> http://www.eset.com
>>
>>
>>
>>
> _______________________________________________
> 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
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to