OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Orchard Repository reading Locking the table #8081

Open ghost opened 5 years ago

ghost commented 5 years ago

I can see why locking is necessary in some cases , specially in Cms frameworks . while reading Repository.Table the Table is locked. since the Isolation level is ReadCommitted . but what I didn't quiet understand is why the table is still locked even after the reading is completed . Converting to a List should be enough to release the table ? if not what's the proper way to read using Orchard repositories and release the table after the reading is complete ?

MatteoPiovanelli-Laser commented 5 years ago

What version/branch are you working with? We did a bit on locking in dev

ghost commented 5 years ago

@MatteoPiovanelli-Laser release 1.10x

MatteoPiovanelli-Laser commented 5 years ago

If you are using MSSql, be aware that their implementation of ReadCommitted is slightly different by what has been implemented by every one else I am aware of. That is why we had to do a bunch of stuff to handle concurrency and locking. It's in dev now. It may be worth to try whatever you are doing with the dev branch, and see whether that fixes the issue you are seeing. If it does not, I think I would need a lot more detail on the issue itself to help you.