Menu

Objects get inserted multiple times

2005-05-20
2013-03-07
  • Nobody/Anonymous

    Hello. I'm experimenting with the Framework (Version 2.2 RC1 with MS SQL) for the first time.
    I created a class and a table with an integer id that is assigned by the sql server. I used the 'identity' attribute in the mapping file. When I create an instance of my class and save it everything works fine. A record gets inserted into the db and the object gets it ID value set. But when I keep using this object, alter some properties and save it again, the framework doesn't update the existing record but creates a second record.
    I solved this problem by creating a new instance after saving for the first time and retrieving the data using the id. But I guess(hope) there is a better solution. Thanks for any help in advance.

    Martin

     
    • Richard Banks

      Richard Banks - 2005-05-20

      It sounds suspiciously like a bug....

      I'll try and get some time to look into it over the next few days.

      - Richard.

       

Log in to post a comment.