最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

LiteDB: is there a need to flush the database after write operations - Stack Overflow

programmeradmin4浏览0评论

We use litedb to pull information from a mongodb instance and "export the configuration" of our app. The export translates the Mongo.Bson.BsonDocuments to LiteDb documents and saves them to collections in a litedb file. After that, a 7zip operation is run to package it up for developers to load that configuration of our app on a local dev machine.

We frequently encounter what appears to be a corruption error when we receive the file.

I'm speculating there's an operation thats in the process of writing to the litedb file when 7zip is compressing the byte stream, thus leaving the litedb file itself, from the archive standpoint in a bad state.

Is there a need to flush / close the Litedb instance? Is there a way to force flush? I'm pretty sure we are calling Dispose by applying using statements around the writes.

发布评论

评论列表(0)

  1. 暂无评论