These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Composite key problem urgent
PostPosted: Tue Mar 06, 2007 3:32 am 
Newbie

Joined: Tue Jan 16, 2007 1:29 am
Posts: 5
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,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.