Hi,
I have 2 tables in my database, Parent and Child.
In my mappings Child is a subclass of Parent.
Parent contains 2 columns Id1 and Id2 and there is a unique constraint on the table so that the Id1 and Id2 combination is unique.
now I have an entry in the Parent table and I need to promote it to a Child entry.
so in my code I:
1) start a transaction
2) create a new Child object which has the same Id1 and Id2 values as the Parent object
3) delete the old parent object which i need to promote
4) save the Child object
5) commit the transaction
However on saving(step 4) I get a error which is from the unique db constraint. <- should nhibernate not realise that the original parent object has been deleted within the transaction already?
Any help would be appreciated.
|