SqlCe database corruption
Hi; there;
I know that power failure can corrupt a sdf file (http://support.microsoft.com/kb/296076/en-us)
Apart from that, is there any other reason can corrupt a SqlCe2.0 sdf database?
Another problem I found in my sdf database is corrupted record. There is a record in the database has all field with "null" value. When I tried to compact this database in "Query Analyzer", it has cursor there forever. I can still open the database and view those record. I tried to delete this record by saying "delete from job where ... is null", that database is fixed!!! I can compact that dataase again.
Note: I have transaction when writing data to database and my application has quite a lot database corruption issue which is nightware now.
Does anybody know what causes this and how to avoid this problem?
[994 byte] By [
Qiuwei] at [2008-1-7]
We have tried to address power failure problem in SSCE3.0 by a different flushing technique. You might lose some changes but no corruption. So you will experience less corruptions when you move to SSCE3.x versions. Also there are utilities like Verify/Repair to repair the databases in SqlCeEngine.
Even with these in place we keep encountering corruptions now and then if sdf faile are on SD cards. We recommend things like TFAT etc. But I am not aware of any specific cause that can lead to it.
Thanks
Raja [MSFT]
If your question is answered please mark it so.
Thanks.
I still see some of my user have those null record in the database, not many, but we do still have.
I've avoided to use sqlce database for my transactional data because business cannot afford the data missing issue and boss doesn't want to hear it is MS problem.
By the way, what does "might lose some changes"?
Cheers
"Might lose som changes" means that there is a delay between inserts/updates/deletes being made and being commited to disk. This in controlled by the "flush interval" connection string setting:
| flush interval-or-ssce:flush interval | Specified the interval time (in seconds) before all committed transactions are flushed to disk. If not specified, the default value is 10. |