litedb-org / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.66k stars 1.25k forks source link

[BUG] Use EnterTransaction() before EnterLock #2484

Closed 390620652 closed 5 months ago

390620652 commented 6 months ago

Version 5.019/OS/.NET 8. (REQUIRED)

Describe the bug When I call Upsert function in two thread, this exception might occur occasionally.

---> LiteDB.LiteException: Use EnterTransaction() before EnterLock(name) at LiteDB.Engine.EngineState.Validate() at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func2 fn) at LiteDB.LiteCollection1.Upsert(T entity)

JKamsker commented 6 months ago

Could you please provide a small repro?

JKamsker commented 5 months ago

The bug should have been resolved in v5.0.20