-->
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: Problem on update() of detached object
PostPosted: Mon Jul 03, 2006 6:36 pm 
Newbie

Joined: Tue Aug 03, 2004 5:42 pm
Posts: 16
I'm a new user of Hibernate (3.1.3). Used Elver to generate mapping file for an EMF model. Elver tutorial works fine. I then played around a bit. I retrieved a couple of objects in a session and then closed it. Then opened up another session and tried to reattach one of the earlier retrieved objects using update(). The cascading function tries to cascade the update to the other object since it was associated to the first and then fails while trying to insert it (the second object) into the DB since apparently some non-null columns dont have values (ConstraintViolationException).

I havent furnished the whole code, but dont want to confuse the issue - the idea is that when I try to reattach an object that Hibernate just retrieved how can an update possibly give a constraint violation exception? Duplicate I can understand (because it is still there in the DB), but constraint violation?

I'm just trying to understand things here. This piece of code is not important, but I would love a pointer to a place where reattachment etc is explained in detail (the book "Hibernate in Action" and the manual are good, but I havent found the answers there)

I can get more detailed if necessary. Hoping its an RTFM issue - I simply need to know which M and where.

Thanks

Sundeep


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.