1. Taro L. Saito
  2. sqlite-jdbc
  3. Issues
Issue #30 resolved

NestedVM driver incorrectly claims a large database file is corrupt

created an issue

A large (15 GB) SQLite database which appears to be fine from the sqlite3 command line client returns stack trace below when a query is prepared via sqlite-jdbc-3.7.2.jar on Mac OS X 10.8 (presumably using the NestedVM engine since no native one is available).

I have confirmed the same database is accessible via sqlite-jdbc-3.7.2.jar on a Windows machine using the native engine, so I'm guessing this issue is specific to the NestedVM driver. Other smaller databases seem to work fine, so I am assuming the problem is likely connected to the large size of the database.

java.sql.SQLException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed)
    at org.sqlite.DB.newSQLException(DB.java:383)
    at org.sqlite.DB.newSQLException(DB.java:387)
    at org.sqlite.DB.throwex(DB.java:374)
    at org.sqlite.NestedDB.prepare(NestedDB.java:134)
    at org.sqlite.DB.prepare(DB.java:123)
    at org.sqlite.PrepStmt.<init>(PrepStmt.java:42)
    at org.sqlite.Conn.prepareStatement(Conn.java:404)
    at org.sqlite.Conn.prepareStatement(Conn.java:399)
    at org.sqlite.Conn.prepareStatement(Conn.java:383)

Comments (7)

  1. mattsheppard reporter

    Confirmed that isNativeMode returs false, and the database is reported as corrupt (as above) where as the database seems fine running the same query fromt he sqlite3 command line tool.

  2. mattsheppard reporter

    It's fine to resolve this from my point of view, as I only really cared that it wasn't working on my Mac, but presumably the problem still exists in the NestedVM mode. I did try to test it with the snapshot from issue 29 but could not seem to switch to the NestedVM mode to do so.

    That said, I think I saw something somewhere suggesting that the intention was that that the NestedVM mode was to be discontinued, so maybe it's no longer relevant.

  3. Log in to comment