I have tested the Nested JDBC driver in Linux ((K)Ubuntu 7.04) and the
same problem exists there aswell. I also tried your versions of the
sqlite3 and both, the JIT mode and interpreted mode versions had the
same issue aswell.

Here's a snippet of Java code that will reproduce the problem:

[code]

Class.forName("org.sqlite.JDBC");

Connection connection =
DriverManager.getConnection("jdbc:sqlite:test.db");

Statement statement = connection.createStatement();

statement.executeUpdate
(
    "CREATE TABLE IF NOT EXISTS messages ("
    + "id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,"
    + "data TEXT NOT NULL);"
);
statement.close();

StringBuilder sb = new StringBuilder();
for (int j = 0; j < 300; ++j)
{
    sb.append("abcdefghijklmnopqrstuvwxyz");
}

final String data = sb.toString();

connection.setAutoCommit(false);

for (int i = 0; i < 300; ++i)
{
    PreparedStatement ps = connection.prepareStatement
    (
        "INSERT INTO messages (data) VALUES (?);"
    );
    ps.setString(1, data);
    ps.executeUpdate();
    ps.close();
}
connection.commit();

Statement delete = connection.createStatement();
delete.executeUpdate("DELETE FROM messages WHERE id < 150;");
delete.close();
connection.commit();

connection.setAutoCommit(true);

Statement vacuum = connection.createStatement();
vacuum.executeUpdate("VACUUM;");
vacuum.close();

connection.close();

[/code]

After executing that code if you try to access the database (test.db)
even with the official sqlite3 binary, it will say "SQL error:
database disk image is malformed" if you try to get anything from the
database (for example: "select * from messages;").


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLiteJDBC" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlitejdbc?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to