-->
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.  [ 2 posts ] 
Author Message
 Post subject: What Causes session.save(obj) to generate Select?
PostPosted: Wed Nov 09, 2005 10:17 pm 
Newbie

Joined: Fri Nov 04, 2005 3:04 pm
Posts: 15
I have the following hibernate code to save my object

Code:
session = getHibernateSession();         
Serializable serObj = session.save(wVO);


It works fine, but some time insted of Insert SQL it generates all Select SQL

How can i debug this? any suggessions please.

Thanks,
mp


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 10:54 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Is the id for the classes that exhibit this behaviour generated in java code (rather than in the database)? And do you also commit/flush your session? Hibernate may have postponed the insert if it doesn't need to do it immediately.

If the id is generated by the database (identity, select newId(), something list that) then the insert should be immediate. In that case, can you post your mapping for further investigation?


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