I am trying to add an index on an mdb file (1-2 GB in size). While creating the index I am encountering the following exception:
Exception in thread "main" java.io.IOException: Page number 334783 already added to usage map, expected range 334775 to 335287
at com.healthmarketscience.jackcess.impl.UsageMap.updateMap(UsageMap.java:347)
at com.healthmarketscience.jackcess.impl.UsageMap$InlineHandler.addOrRemovePageNumber(UsageMap.java:517)
at com.healthmarketscience.jackcess.impl.UsageMap.addPageNumber(UsageMap.java:314)
at com.healthmarketscience.jackcess.impl.IndexData.addOwnedPage(IndexData.java:376)
at com.healthmarketscience.jackcess.impl.IndexPageCache.allocateNewCacheDataPage(IndexPageCache.java:758)
at com.healthmarketscience.jackcess.impl.IndexPageCache.splitDataPage(IndexPageCache.java:637)
at com.healthmarketscience.jackcess.impl.IndexPageCache.preparePagesForWriting(IndexPageCache.java:180)
at com.healthmarketscience.jackcess.impl.IndexPageCache.write(IndexPageCache.java:103)
at com.healthmarketscience.jackcess.impl.IndexData.update(IndexData.java:437)
at com.healthmarketscience.jackcess.impl.TableImpl.updateTableDefinition(TableImpl.java:2631)
at com.healthmarketscience.jackcess.impl.TableImpl.populateIndexData(TableImpl.java:1432)
at com.healthmarketscience.jackcess.impl.TableImpl.mutateAddIndexData(TableImpl.java:1407)
at com.healthmarketscience.jackcess.impl.TableUpdater.addIndex(TableUpdater.java:179)
at com.healthmarketscience.jackcess.impl.TableUpdater.addIndex(TableUpdater.java:148)
at com.healthmarketscience.jackcess.IndexBuilder.addToTable(IndexBuilder.java:212)
at com.db.result.service.ResultExecutorService.main(ResultExecutorService.java:150)
Below is the code that I am currenlty using for the same:
~~~
ResultExecutorService e = new ResultExecutorService();
Table t = e.getTable("up_10_2018_222");
Index index = new IndexBuilder("ROLL_NO").addColumns("ROLL_NO").addToTable(t);
~~~
I am using jackcess v2.1.11
Please help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
so that most likely means you've hit a bug inside jackcess. this typically results from some "unexpected" situation inside the database itself. ideally, it would be great if you could provide a copy of this database that could be used to determine what the actual problem is so that it could be fixed in jackcess. (you don't have to post it publicly, if you are willing, you could share it with me directly).
that said, you can usually work around problems like this by opening the problem database in access and executing a "compact and repair" on it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you share it via a link to google drive, box, or similar service? you can email me directly via my sourceforge email: jahlborn at users dot sourceforge dot net.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to add an index on an mdb file (1-2 GB in size). While creating the index I am encountering the following exception:
Exception in thread "main" java.io.IOException: Page number 334783 already added to usage map, expected range 334775 to 335287
at com.healthmarketscience.jackcess.impl.UsageMap.updateMap(UsageMap.java:347)
at com.healthmarketscience.jackcess.impl.UsageMap$InlineHandler.addOrRemovePageNumber(UsageMap.java:517)
at com.healthmarketscience.jackcess.impl.UsageMap.addPageNumber(UsageMap.java:314)
at com.healthmarketscience.jackcess.impl.IndexData.addOwnedPage(IndexData.java:376)
at com.healthmarketscience.jackcess.impl.IndexPageCache.allocateNewCacheDataPage(IndexPageCache.java:758)
at com.healthmarketscience.jackcess.impl.IndexPageCache.splitDataPage(IndexPageCache.java:637)
at com.healthmarketscience.jackcess.impl.IndexPageCache.preparePagesForWriting(IndexPageCache.java:180)
at com.healthmarketscience.jackcess.impl.IndexPageCache.write(IndexPageCache.java:103)
at com.healthmarketscience.jackcess.impl.IndexData.update(IndexData.java:437)
at com.healthmarketscience.jackcess.impl.TableImpl.updateTableDefinition(TableImpl.java:2631)
at com.healthmarketscience.jackcess.impl.TableImpl.populateIndexData(TableImpl.java:1432)
at com.healthmarketscience.jackcess.impl.TableImpl.mutateAddIndexData(TableImpl.java:1407)
at com.healthmarketscience.jackcess.impl.TableUpdater.addIndex(TableUpdater.java:179)
at com.healthmarketscience.jackcess.impl.TableUpdater.addIndex(TableUpdater.java:148)
at com.healthmarketscience.jackcess.IndexBuilder.addToTable(IndexBuilder.java:212)
at com.db.result.service.ResultExecutorService.main(ResultExecutorService.java:150)
Below is the code that I am currenlty using for the same:
~~~
ResultExecutorService e = new ResultExecutorService();
Table t = e.getTable("up_10_2018_222");
Index index = new IndexBuilder("ROLL_NO").addColumns("ROLL_NO").addToTable(t);
~~~
I am using jackcess v2.1.11
Please help.
so that most likely means you've hit a bug inside jackcess. this typically results from some "unexpected" situation inside the database itself. ideally, it would be great if you could provide a copy of this database that could be used to determine what the actual problem is so that it could be fixed in jackcess. (you don't have to post it publicly, if you are willing, you could share it with me directly).
that said, you can usually work around problems like this by opening the problem database in access and executing a "compact and repair" on it.
Hi James
Please specify how I can share it dircetly with you
Can you share it via a link to google drive, box, or similar service? you can email me directly via my sourceforge email: jahlborn at users dot sourceforge dot net.
HI James
I have messaged you the link for the file I am using. Please have look.
awesome, i got the file, thanks! i'll see what i can figure out.
I've created this bug to track progress on this problem: https://sourceforge.net/p/jackcess/bugs/147/
thanks for taking the time to get me the file! the fix will be in the next release.
Thanks James.
I will work with the snapshot till the release is available.
Wanted to make sure you knew that 2.1.12 is now released.