-->
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: SQLQueryImpl.executeUpdate() doesn't set session's flushmode
PostPosted: Fri Jan 05, 2007 2:17 pm 
Newbie

Joined: Wed Sep 06, 2006 7:32 am
Posts: 6
Hibernate version: 3.2.0

I've noticed that SQLQueryImpl.executeUpdate() doesn't honour the query's flushmode by calling before() and after() around the main body of the method. It does honour flushmode for list(), scroll() etc. This differs from QueryImpl.executeUpdate(), though I can't see any obvious reason why. Is this deliberate (and if so, why), or is it just an oversight?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 06, 2007 1:36 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
I guess it's just related to the default strategy. For example, with FlushMode.AUTO, list() is known to be called after a flush() has been done. This helps you working on a good dataset, if some data are not in the db yey. Though, when updating, I guess Hibernate does not do any automatic flush(), so you have to call flush() by yourself before calling executeUpdate() if needed.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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.