Skip to content
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

[BUG] Use EnterTransaction() before EnterLock(name) when update item #2463

Closed
lanopk opened this issue Apr 2, 2024 · 1 comment
Closed
Labels

Comments

@lanopk
Copy link

lanopk commented Apr 2, 2024

Version
5.0.19 / .net 6.0.28

Describe the bug
Call insert/update/delete from several threads.
Each call uses a lock, but find-related calls do not use a lock.
Errors never occur when doing simple tasks, but errors always occur when processing a lot of tasks.
The occurrence location is the EnterLock function in LockService.cs and occurs in the ENSURE section.

DB Update Error : LiteDB.LiteException: Use EnterTransaction() before EnterLock(name)
   at LiteDB.Engine.LockService.EnterLock(String collectionName)
   at LiteDB.Engine.Snapshot..ctor(LockMode mode, String collectionName, HeaderPage header, UInt32 transactionID, TransactionPages transPages, LockService locker, WalIndexService walIndex, DiskReader reader, DiskService disk, Boolean addIfNotExists)
   at LiteDB.Engine.TransactionService.CreateSnapshot(LockMode mode, String collection, Boolean addIfNotExists)
   at LiteDB.Engine.LiteEngine.<>c__DisplayClass27_0.<Update>b__0(TransactionService transaction)
   at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func`2 fn)
   at LiteDB.LiteCollection`1.Update(T entity)

The problem does not occur in 5.0.16, but occurs whenI update (Nuget) to version 5.0.19.

If you need more debugging on my part, please let me know what I should do and I will debug it in more detail.

Thank you.

@lanopk lanopk added the bug label Apr 2, 2024
@lanopk lanopk closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
@lanopk
Copy link
Author

lanopk commented Apr 2, 2024

This is a duplicate.
I will leave a comment at #2442.

jacobalbano added a commit to jacobalbano/Danbo that referenced this issue Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant