-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate Doing Update instead of Insert
PostPosted: Thu Jun 09, 2005 12:41 pm 
Beginner
Beginner

Joined: Mon Jun 06, 2005 6:48 pm
Posts: 45
I am using version 3.0.5 and I am trying to insert a record and noticed hibernate is doing an update instead of an insert into an empty table. Why would that happpen? Seems like a serious bug. I do have some dependancies with two detail records which are read correctly first before hibernate tries to do an update (instead of insert). The cascade is set to "none" for all occurances in the map file.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 12:44 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/ForumMailingli ... AskForHelp


Top
 Profile  
 
 Post subject: Hibernate Doing Update instead of Insert
PostPosted: Thu Jun 09, 2005 12:52 pm 
Beginner
Beginner

Joined: Mon Jun 06, 2005 6:48 pm
Posts: 45
Thanks for the reply. Alreadly checked FAQ, forum and Google and no answers but still looking.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 1:19 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
again:
http://www.hibernate.org/ForumMailingli ... AskForHelp

you have to explain exactly what your problem is (code, mapping...)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: Hibernate Update instead of insert
PostPosted: Thu Jun 09, 2005 1:23 pm 
Beginner
Beginner

Joined: Mon Jun 06, 2005 6:48 pm
Posts: 45
Fixed the problem by using session.saveOrUpdate() instead of session.save() and adding unsaved-value="null" in mapping file. Not what I wanted to do but that is what it took.

Interesting I got nor error messages in the log file using log4j but still adding appenders that hibernate asks for.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.