Bug #117404 NotSupportedException: All objects in the EntitySet must have unique primary keys.
Submitted: 6 Feb 17:31 Modified: 7 Feb 8:33
Reporter: Anton Lehavka Email Updates:
Status: Need Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.40 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: NotSupportedException, unique primary keys

[6 Feb 17:31] Anton Lehavka
Description:
After upgrading to MySQL Server version 8.0.40, I encountered the following error in my application:

NotSupportedException: All objects in the EntitySet 'MssGeneralContext.Users' must have unique primary keys. However, an instance of type
'Domain.Mss.Seed.Profiles.OrderingCustomerAgg.OrderingCustomerTeamMember' and an instance of type
'Domain.Mss.Seed.Authentication.UserAgg.User' both have the same primary key value.

It appears the issue is caused by overlapping primary keys for the following two entities:

OrderingCustomerTeamMember
User

Here is the class declaration for OrderingCustomerTeamMember:
public class OrderingCustomerTeamMember : User

Please investigate if this behavior is a bug or a change in functionality with MySQL Server v8.0.40. If it's a known issue, guidance on mitigating or resolving it would be greatly appreciated.

How to repeat:
Install MySQL Server v8.0.40.

Set up tables Table 1 and Table 2 with the same primary key values and corresponding relation. Attempt to query or update the GeneralContext EntitySet.

The issue is not reproducible with MySQL Server version 8.0.39.
[7 Feb 8:33] MySQL Verification Team
Hi,

This is not enough data to reproduce the problem. Please give us enough data to reproduce problem. I assume this is some java code you are using? Please create
 - sample db (create... insert...)
 - sample source code that we can compile and test
 - please use latest connector and latest mysql (8.0.41 is latest 8.0)

Thanks.