Menu

Corrupt Database after Insert

2022-05-31
2022-10-29
  • Oghenekaro Osogba

    Hello, currently using jackcess 4.0.1. I am trying to insert rows into empty tables in an access db (accdb). When the inserts get ~50000. The database gets corrupted it shows the error message which I tagged. The error is resolved by compact and repair but I was wondering if anyone has an idea why that is happening in the first place.

     
    • James Ahlborn

      James Ahlborn - 2022-05-31

      do you have some example code that could be used to recreate the issue?

       
    • James Ahlborn

      James Ahlborn - 2022-09-07

      any more feedback?

       
  • Chang Cao

    Chang Cao - 2022-10-14

    Hi, I'm seeing the same problem. Run the following, open mdb in Access and try to delete some rows, then get the error message.

    File dbFile = new File("test.mdb");
    Database db = new DatabaseBuilder(dbFile).setFileFormat(Database.FileFormat.V2000).create();
    Table table = new TableBuilder("Test")
            .addColumn(new ColumnBuilder("KEY", DataType.LONG))
            .addIndex(new IndexBuilder(IndexBuilder.PRIMARY_KEY_NAME).addColumns("KEY").setPrimaryKey())
            .toTable(db);
    for (int i = 0; i < 100000; i++) {
        table.addRow(i);
    }
    db.close();
    

    I guess it occurs when the primary key is set and the table size exceeds 2MB.

     
    • James Ahlborn

      James Ahlborn - 2022-10-14

      thanks for the test case! i created a bug https://sourceforge.net/p/jackcess/bugs/156/

       
    • James Ahlborn

      James Ahlborn - 2022-10-28

      in case you missed the update on the ticket, that bug is now fixed in trunk and will be in the 4.0.3 release.

       
      • James Ahlborn

        James Ahlborn - 2022-10-29

        this fix was released. the 4.0.3 release did not complete successfully, so this ended up in 4.0.4.

         

Log in to post a comment.