-->
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: a different object with the same identifier value was alread
PostPosted: Tue Jul 20, 2010 12:35 am 
Newbie

Joined: Tue Jul 20, 2010 12:28 am
Posts: 2
Hi
I am fairly new to NHbernate and am getting the following error:

a different object with the same identifier value was already associated with the session:

I have an Entity object which has a list of Invoices
I have an Invoice object which can have a sender (Entity) and a recepient (Entity)

Users can manually create invoices sent to them in a paper form so the process is:
1) User selects a sender from the repository (I get the entity using NHibernate)
2) Enters all the invoice details and saves
2)a) On the save process i create the invoice object and assign it the entity (sender) and a receipent (Entity) which is the logged in user
b) I then call saveorupdate method which then throws the mentioned error

I have also tried to set the invoice in the Entity object before calling saveorupdate method but same error

Can anybody point me in the right direction

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.