Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4561178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:02:16+00:00 2026-05-21T18:02:16+00:00

Here’s my scenario: I am using Silverlight, RIA and POCO objects (no Entity Framework;

  • 0

Here’s my scenario:

I am using Silverlight, RIA and POCO objects (no Entity Framework; we’re working against Oracle and SP’s).

I have a Parent object that contains a collection of Child objects. I have setup the Association and Composition attributes on the Parent correctly. When I want to save changes, the entire object graph gets sent to the server correctly.

The user can add one or more Child objects to the Parent.

Now, if the user adds ONE Child object to the Parent and saves it then everything works. However, when the user tries to add TWO or more new objects to the Parent and then persist, I get the classic error:

System.ServiceModel.DomainServices.Client.DomainOperationException: Submit operation failed. An entity with the same identity already exists in this EntitySet. —> System.InvalidOperationException: An entity with the same identity already exists in this EntitySet.

Now, this is failing on the client. I am tracing everything – the database actually gets updated! Everything gets sent down to the server correctly, the DB gets updated. I check the object keys on the server when the re-query happens and they are correct – all of the new child objects get their ID’s updated from zero to a real number in sequence.

It’s when I get to re-load the Parent object on the client that I get this error. I don’t get it. I am newing up a new Context on the re-load operation; it should be empty and just load the Parent and associated Children. I check the data on the server side before it goes out of the query method – the parent and child data is fine. So what’s happening? Why is my context bitching about not being able to complete this SubmitOperation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:02:17+00:00Added an answer on May 21, 2026 at 6:02 pm

    You gave up too easy – don’t let RIA do it for you!! 🙂

    Here is the deal…

    Since you are working with POCO objects (no EF) you most likely have an identifying attribute ([Key]) on one of your properties designating it the key (or identity) of that object.

    Well…

    When you add 2 consecutive objects, you will most likely default the value of your key to a value of 0. This is a problem for the domain service & context because it attempts to manage the set for you. Well, if after the saving of the objects to the database, you have not updated the key they will both remain with a value of 0.

    Problem!

    The domain service & context attempt to put these two objects in its managed EntitySet and, as such, all objects must be unique.

    So…

    Long and the short of it is… update your key value after saving it to the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.