• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question on Hibernate version property again

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic