• Post Reply Bookmark Topic Watch Topic
  • New Topic

Solution to handle StaleObjectException

 
pyar kushi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From One of a Book, there are 3 ways to handle Concurrent updates.
For Ex., If P1 and P2 is updating A by changing a values in attri1,attri2 and attri2,attri3 respectively.

1. Always overwrite with lastest update on this object - Result : attrib2 and attr3 will have latest data. attri1 is older than P1.
2. Throw exception for the second transtaction Result : Only attrib1 and attr2 will have latest data. attri3 is older than P2. P2 should redo the task.
3. Merge the changes from both the transactions - Result : attrib1 and attr3 will have latest data. attri2 will have the update of P2.

Anyone tell me how to implement the third approach in hibernate.

Thanks in advance
 
grapes are vegan food pellets. Eat this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!