My database contains three tables ‘Person’ , ‘LegalPerson’ and ‘RealPerson’. in my code ‘LegalPerson’ and ‘RealPerson’ classes are driven from ‘Peron’ class the Entity Relationship diagram between these three entities is as following picture:
i use SubClassMap for both 'RealPerson' and 'LegalPerson' mappings. the problem is when i try to save for example a 'LegalPerson' object with Person_Id that is already saved in 'Person' table, i get the following exception: An unhandled exception of type 'NHibernate.StaleObjectStateException' occurred in NHibernate.dll
Additional information: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)