-->
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: session.merge with user assigned identifiers?
PostPosted: Sat Dec 01, 2007 1:17 pm 
Newbie

Joined: Tue May 10, 2005 1:19 pm
Posts: 10
Hello all

I'm having a problem merging an object where the id is generated by user assignment. It seems the presence of a value for the id property causes the merge to decide that the instance is detached rather than transient, leading to a StaleObjectStateException. For most other purposes the version property is used to determine transience instead, which would remove this problem.

Question: why does merge trust the id property even where the class is configured for user assigned ids? Is there some reason its can't detect that case and look at the version property instead? Is this a bug and if not, is there a workaround? Writing my own wrapper for merge seems like a bit of a kludge.

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.