in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Vacuum & database disk image malformed

Last post 07-20-2010 12:03 PM by masc. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-14-2010 3:16 AM

    • Nobig
    • Not Ranked
    • Joined on 04-14-2010
    • Posts 2

    Vacuum & database disk image malformed

    Hi, I use a SQLite Database on a Windows CE device. After a VACUUM, when i try to connect to my database, I've this error : "The database disk image is malformed". I use the .Net Compact Framework 3.5, SQLite 3.6.22 and Windows CE 6. I don't know if this error is a result of a bug in SQLite, in Windows CE or in System.Data.SQLite. So can you help me ? Thanks.
    Filed under:
  • 04-17-2010 1:31 PM In reply to

    Re: Vacuum & database disk image malformed

    I'm not sure what the problem is either.  Is the database password protected?

     

  • 04-26-2010 1:30 AM In reply to

    • Nobig
    • Not Ranked
    • Joined on 04-14-2010
    • Posts 2

    Re: Vacuum & database disk image malformed

    No, there is no password ... In order to test this operation, I tried this command many times . Most of the time, it's work but sometimes I've got the disk image malformed error. But I don't know why.
  • 07-20-2010 12:03 PM In reply to

    • masc
    • Top 50 Contributor
    • Joined on 10-26-2007
    • Posts 20

    Re: Vacuum & database disk image malformed

    it's been reported here as well after upgrading to 1.0.66.0 (3.6.23.1), but it could also be coincidence.

    Db is not pw protected and normally resides on RAM disk.
    During maintenance phase (usually over night) db will be vacuumed and device rebooted.
    Db is copied to SDCard temporarily, where following commands are executed:

    PRAGMA temp_store=1;
    PRAGMA temp_store_directory='\Storage Card\tmp\' ;
    VACUUM;

    If there was no error db is copied back to RAM, application shuts down (in a clean manner, closing db aso.) and the device is rebooted.
    Surprsingly, log shows the first command failing (ANALYZE) on next application start using the vacuumed db. (malformed disk image)

    I guess I will add verification PRAGMA integrity_check; to circumvent the problem for now.

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems