• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
reddy kumar pavan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic