-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Batching through a table variable may not work for non-default collations #7172
Comments
@divega you are right. I create multiple parent and child entities. Which reference each other with case-sensitive guid keys. (something like Pk8hUi....) All of them are added by |
@seriouz thanks for confirming. Please let me know if the suggested workaround helps. |
We would need to add the ability of specifying collation for a given column to be able to use it in the update pipeline. |
@seriouz As a workaround you can specify the collation as part of the store type: .Property(e => e.FieldGuid).HasColumnType("nvarchar(22) COLLATE SQL_Latin1_General_CP1_CS_AS"); |
Should at least do the R.E. work. We may need to look at the whole update pipeline "experience" as well... |
Also see high-level collations issue #19866 |
Note that since #27372 we no longer use table variables by default - we use simple OUTPUT, rather than OUTPUT INTO, unless the user explicitly tells us that the table has triggers. |
- Add property annotation RelationalAnnotationNames.Collation to runtime model - Consider column collation annotation when creating DELCARE TABLE statement - Fixed unit test Fixes dotnet#7172
I created a PR #29518 with a proposed fix to this issue. |
Workaround: Save one parent entity at a time. It correctly saves related data in its properties. I didn't see this workaround mentioned anywhere, but it was very helpful for us. |
(copied from @seriouz's comment at #6577 (comment))
I think @seriouz meant to say
SaveChanges()
fails, as opposed to querying data.A possible workaround is to disable batching in either the
OnConfiguring()
method on theDbContext
class or on theAddDbContext()
method inStartup
:cc @AndriySvyryd as FYI
The text was updated successfully, but these errors were encountered: