Some more details:

The scenario here is:
DB->Exec(Begin); //Transaction begin
DB->Step(); // Execute my query that is trying to insert a record in the db
DB->Exec(End); //End the transaction

When the last step is executed i.e. the end step, I am seeing that Sqlite
now tries to write the record to the filesystem using sqlite3OsWrite().
There are 5 sqlite3OsWrite() calls to this function made in this scenario.
To emulate a scenario where the filesystem would be interrupted I allow only
2 writes and then shutdown the application. The next time I bring up the
application and open the database, then the database is sometimes (a) not
able to find even any previous records that were there in the database (b)
database gets corrupted in the sense that it returns incorrect values when
queried. 

I used the SQLite-Browser (http://sqlitebrowser.sourceforge.net) on Windows
to open my database and it was able to read all the previous records fine.
So it clearly is that sqlite implementation that is being used by my
application is not able to recover from a partial I/O commit.

The sqlite version that I have is 3.0.8.



manas.abi wrote:
> 
> I get this problem only after I stop a transaction in between which makes
> me think that there is a problem with SQLite code. 
> 
> Also, I forgot to mention that I am using SQLite version 3.0.8. Do you
> know about any such bug in this version which was removed in the later
> versions?
> 
> Thanks & Regards
> Manas
> 

-- 
View this message in context: 
http://www.nabble.com/Database-Corruption-tp17523984p17545283.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to