|
HI,
I am having problem with composite-keys
I have one table TEST as,
Col1 Col2 Col3 Col4
1 1 1 0
1 2 1 1
Where Col 1,2 and 3 are composite keys.
I have 2 objects of Test class where data only differs in col 2,4
Now my requirement is to update the data from these objects to table.
The first one updates fine. But when its executing the second one it throws exception.
Like
“a different object with the same identifier value was already associated with the session: “
Stacktrace:
"場所NHibernate.Impl.SessionImpl.CheckUniqueness(EntityKey key, Object obj)
場所c:\\net\\nhibernate\\nhibernate\\src\\NHibernate\\Impl\\SessionImpl.cs:行2000\r\n
場所NHibernate.Impl.SessionImpl.DoUpdateMutable(Object obj, Object id, IEntityPersister persister)
場所c:\\net\\nhibernate\\nhibernate\\src\\NHibernate\\Impl\\SessionImpl.cs:行1668\r\n
場所NHibernate.Impl.SessionImpl.DoUpdate(Object obj, Object id, IEntityPersister persister)
場所c:\\net\\nhibernate\\nhibernate\\src\\NHibernate\\Impl\\SessionImpl.cs:行1698\r\n
場所NHibernate.Impl.SessionImpl.Update(Object obj)
場所c:\\net\\nhibernate\\nhibernate\\src\\NHibernate\\Impl\\SessionImpl.cs:行1539\r\n
場所Kgisl.Curva.DataAccess.BaseDataAccess.SaveOrUpdate(IList items)
場所D:\\Projects\\Curva\\DataAccess\\BaseDataAccess.cs:行74"
Can somebody tell me how I can solve this problem.
Thanks,
|