This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Both open two different sessions at the same time and load the same table row in memory.
If User1 and User2 both update some columns of that row and suppose User1 commits the transaction first.
What will happen when User2 commits the transaction. Will his changes be overwritten over User1's changes in the database table?
The Version attribute can also be helpful in performing optimistic locking:
"Hibernate uses the updated row count to detect conflicting data modifications. Hibernate will automatically disable JDBC batch updates if you are using versioned data, since some JDBC drivers return incorrect values after UPDATEs "