This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes when we update in hibernate will it always fire select query before updating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "when we update in hibernate will it always fire select query before updating" Watch "when we update in hibernate will it always fire select query before updating" New topic
Author

when we update in hibernate will it always fire select query before updating

reddy kumar pavan
Greenhorn

Joined: Jul 01, 2007
Posts: 15
Hi All,

I have one doubt in hibernate When i update any record in the database will it always fire select query first and then fire update query or if not in what cases will it fire select and then update.

Please let me know.

Thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you using Hibernate's optimistic locking mechanism? It needs to check the version has not changed before updated. There is no way round this, its part of the optimistic locking pattern.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: when we update in hibernate will it always fire select query before updating