-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage' #879
Comments
Now I can copy data from broken data file to a new file to handle the problem.But I think it's necessary to fix it thoroughly. |
What did you mean you can copy data from broken file to new file? After power on, first connection must run recovery..... But, last time 4.1.1 I think that I back file write again to default write..... because performance issues (in HDD disks)... I think I will use this as a connection string parameter... can be some difference in OS or HDD/SSD |
The recovery process is not very thoroughly, some collection structure is still broken.So I have to use LiteDB to copy data of collections to another file, then the new file can be used normally. |
Hi @lidanger, parameter added: "flush: true" will use Is in master branch, if you can test I appreciate. Will release soon on nuget |
Sorry, I went out with a business trip and I saw your words just today. I tested it just now on win 7 in a virtual machine.It seems there is no effect using litedb with option flush:true . .net framework 4.0 Read - 读取数据出错System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.IndexPage'. |
test code: using LiteDB; namespace Test
} |
config:
|
Hello @mbdavid , i think there are still concurrency problems like were in version 3.x.x. |
I too believe there might still be problems in 4.1.4. Our logs indicate around 2000 crashes from 150 users.
We use a single instance of LiteDb for access from different threads. PostFrog basically collected accumulated logs and uploads it to our database.
We add a few logs and then do a manual PostFrog when our application starts and this is the case where these specific exceptions occur. But I have also seen exceptions happen during the lifetime of the application during periodic log uploads |
Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks! |
This came again, 10 minutes after power on.
System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage'.
at LiteDB.PageService.GetPage[T](UInt32 pageID)
at LiteDB.TransactionService.PersistDirtyPages()
at LiteDB.LiteEngine.Transaction[T](String collection, Boolean addIfNotExists, Func
2 action) at LiteDB.LiteEngine.Insert(String collection, IEnumerable
1 docs, BsonType autoId)at LiteDB.LiteEngine.Insert(String collection, BsonDocument doc, BsonType autoId)
at LiteDB.LiteCollection`1.Insert(T document)
at scsoft.wrySite.Acquisition.DaqManager.???
??????()
LiteDB version:4.1.1.0
OS:Windows 7
.NET Framework:4.0
The text was updated successfully, but these errors were encountered: