• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on Hibernate version property again

 
Steven Jiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is

When I do a hql select query joining a few table together. hibernate does update version field, dont know why.

Anybody know why? I reckon only update a table will trigger an update on the version field, right?

the query is like " from A a inner job a.b b inner join b.c where ....."

Thanks
Steve
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Anybody know why? I reckon only update a table will trigger an update on the version field, right?

Yes. There is no need to update a version number if all you are doing is selecting the data.
 
Steven Jiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:

Anybody know why? I reckon only update a table will trigger an update on the version field, right?

Yes. There is no need to update a version number if all you are doing is selecting the data.


I didn't update the token no manually, I just setup hibernate(copy from my project) and run a simple select query.

Do you know any condition, the select will trigger the updating token field event??

Thanks
Steven
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Think about it - why would a select statement require optimistic locking?
 
Steven Jiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:No. Think about it - why would a select statement require optimistic locking?


Thanks again Paul, that did happen, as I can not copy over whole project configure and code, better ask my TL . appreciate your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic