Hi,
Currently we are facing an issue in our project while saving a joined sub class in NHibernate it throws an exception - "a different object with the same identifier value was already associated with the session". The class Artist inherit the Account class and in db the artist table id column is the primary and foreign key column from Account.Id
HibernateMapping: <class name="Account" table="tblAccounts"> <id name="ID"> <column name="id" sql-type="int" not-null="true"/> <generator class="identity" /> </id> <joined-subclass name="Artist" table="tblArtists" > <key column="id" /> </joined-subclass> </class>
I have removed all the property tags as it will be too long.
In our service class:
1)Initialize new Account class 2)Assign property values and save. Account saves perfectly. 3)Initialize new Artist class 4)Assign all properties and save, throws exception.
Thanks in advance for you help.
|