wood burning stoves 2.0*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when we update in hibernate will it always fire select query before updating
 
Similar Threads
question on Hibernate version property again
Error: java.sql.Timestamp
"merge" and "persist" query
Batch update in EJB3
Hibernate Automatic Versioning