1
Vote

Can't delete indexed items after defragmentation

description

I have a database that uses a UniqueIndex. Deleting an object with a unique index works as expected until I defragment the database.

After I defragment the database, I get the error:
Error:273:Index BTree Validation error: Error while deleting key='[unique index value]' value='[ID]'
with the inner exception:
Unable to cast object of type '[stored type]' to type 'NDatabase.Btree.IBTreeNode'.
The attached LinqPad file demonstrates the error (you'll need to change the reference to NDatabase.dll)

file attachments

comments

dylanwolf wrote Dec 16, 2014 at 6:13 PM

It looks like calling RebuildIndex on the newly defragmented file fixes the problem.