-->
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.  [ 3 posts ] 
Author Message
 Post subject: session.save() not returning identity value
PostPosted: Fri Feb 24, 2006 1:10 am 
Newbie

Joined: Fri Feb 24, 2006 1:06 am
Posts: 2
Hibernate version:3.0

Name and version of the database you are using:UDB 8

Hi,
When I say session.save(), record is getting inserted properly in my database with correct identity. But return value of save() method is returning me always 0(zero) instead of identity, which got inserted. But I can get the value from object using getter method once is commit trasaction and close session.

This happens only in my UDB database where table is reference table.
Samething works with HSQL. May I know the cause of this, if any one has come across this situation and how to fix this issue.

Thanks in advance.

Regards,
Rizwan.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 6:40 am 
Beginner
Beginner

Joined: Wed Aug 04, 2004 4:33 am
Posts: 45
Location: Switzerland
How is the id generated?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 1:06 pm 
Newbie

Joined: Fri Feb 24, 2006 1:06 am
Posts: 2
szehnder wrote:
How is the id generated?

Id is generated automatically by hibernate/UDB. <generator> stratergy is given as 'identity' while defining the id in mapping file.

But it inserts the id correctly in database but not returning for some reason.


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