mbdavid / LiteDB

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

[BUG] Use EnterTransaction() before EnterLock #2484

Closed 390620652 closed 3 weeks ago

390620652 commented 1 month 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 4 weeks ago

Could you please provide a small repro?

JKamsker commented 3 weeks ago

The bug should have been resolved in v5.0.20