-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Thread-Safe SqlGenerator implementation #309
base: master
Are you sure you want to change the base?
Conversation
Fix #303 #298 #274 |
@xamele0n Do you happen to have created a nuget package with this fix that you can share? :) |
Nm. I made one myself: https://www.nuget.org/packages/Swush.DapperExtensions/1.7.1-hotfix-concurrency It's basically just the code from this PR. Do note that it only supports .net 6 and 7. |
@skovsende - well.. i did`t noticed that fields are used outside forming sql. I did rewrite implementation according your case. You can try this. |
Default SqlGenerator has properties
IList<IColumn> AllColumns { get; } IList<Table> MappedTables { get; }
that filled and modified in different methods. This data shared across methods inside SqlGenerator in non-threadsafe manner and it can be changed by differrent (parallel) thread.
Whole sql statement must be composed by it`s own SqlGenerator