-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Transaction management made async #6809
Conversation
…to determine transaction behaviour.
I wanted to do this, but I was stuck with IQueryable. 👍 |
I want to continue to use LINQ extension methods directly on |
I made a demo to demonstrate how we can do it with creating custom wrapper methods to all linq extension methods (Where, OrderBy, ToList, ToListAsync...). It is a huge work, but separates creating dbcontext and starting transaction. We can defer starting transaction in this way.
I will continue to work on this. |
Separating dbcontext creation (and obtaining the queryable) and starting transaction didn't work for mongodb. It requires to relate the transaction while obtaining the queryable. It works for EF Core, but the implementation is complicated. Anyway, currently, the best thing we can do is to suggest to use |
We were using sync API to begin transaction. I converted it to async and it brings a significant scalability increase.
But we have a cost: We can not use LINQ extension methods directly on the
IRepository
. Instead, we should useawait IRepository.GetQueryableAsync()
. Because ABP internally may begin transaction with this method call.This doesn't make breaking change, however I made a lot of methods Obsolete and we may remove them in the future which will be a major breaking change.
I updated all the usages including modules.
I will update all the documentation and tutorials. Also, I will write a blog post about that since it effects almost all applications.