Forums Register Login

question on Hibernate version property again

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 


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.
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
No. Think about it - why would a select statement require optimistic locking?
+Pie Number of slices to send: Send
 

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.
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1089 times.
Similar Threads
Hibernate - Legacy Database Question
Index column is null
What causes Hiberante to issue a SQL update command
Hibernate Automatic Versioning
@Version and Locking.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:51:10.