-->
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.  [ 2 posts ] 
Author Message
 Post subject: Session Issue
PostPosted: Sat May 29, 2010 2:25 pm 
Newbie

Joined: Thu May 27, 2010 10:48 am
Posts: 10
I have the following problem

House house = new House();
house.setAddress(addressFromDataBase);

Person person = new Person();
person.setAddress(addressFromDataBase);

person.setHouse(house);

so when I call session.saveOrUpdate(person)

guess what, error:
-> a different object with the same identifier value was already associated with the session

help?


Top
 Profile  
 
 Post subject: Re: Session Issue
PostPosted: Sat May 29, 2010 4:23 pm 
Newbie

Joined: Thu May 27, 2010 10:48 am
Posts: 10
Ow yeah, found it. The solution for all the problems in the world, including war, is called "merge". I got the information from here http://pro-programmers.blogspot.com/200 ... ption.html. I'm quite happy now, I don't need to replicate my Address object.


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

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.