We have 2 HierarchyRoot Entities in our Project until now. Here are the definitions of the 2:

[HierarchyRoot, KeyGenerator(Name = "Root")]
public partial class PadRootEntity : Entity
{ ...

[HierarchyRoot, KeyGenerator(Name = "Root")]
public partial class RepRootEntity : Entity
{ ...

As you can see both have a KeyGenerator with the same name. That causes some mixup in the DB. After a restore we got a duplicate key error when writing new entries to the DB.

The TableMapping also has the same name but that is Ok because they are in different schemas ('Reporting' and 'Projecten'). So in the DB there is a 'Reporting.Root' and a 'Projecten.Root' table present.

Can you please confirm that the naming of the KeyGenerators can cause problems?

Regards Paul

asked Aug 12 '13 at 07:28

Paul%20Sinnema's gravatar image

Paul Sinnema

edited Aug 12 '13 at 07:29

One Answer:

Hello Paul,

I don't know how you do the restore.

However it's worth noting that key generators are always in "default" schema of your database. So your two entities are tied to the same key generator.

answered Aug 12 '13 at 07:38

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview


Once you sign in you will be able to subscribe for any updates here



Asked: Aug 12 '13 at 07:28

Seen: 8,918 times

Last updated: Aug 12 '13 at 07:38

powered by OSQA