This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I didn't understand how optimistic concurrency will work in hibernate?
As per my knowledge, we need to have either VERSION or TIMESTAMP column in persistence table which is mappend to hibernate.
Say we are having TIMESTAMP column then whenever we execute INSERT,UPDATE statement hibernate will modify TIMESTAMP column with system timestamp. When we try to update a row and that row timestamp is differenent from the existing row timestamp then it determines as stale data and it will through the error message.
Please correct me if I'm wrong and also provide some example too.