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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
It sounds suspiciously like a bug....
I'll try and get some time to look into it over the next few days.
- Richard.