• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session.save() not returning identity.

 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look into the hibernate.jdbc.use_get_generated_keys setting explained in a little more detail in the documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic