• Post Reply Bookmark Topic Watch Topic
  • New Topic

Record Locking. Implementation

 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What are the different methods though which we can have Record Locking in J2EE web application so that same record is not edited by more than teo users at a time.
Thanks for the time.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a classic problem in all web development, not just J2EE. The best treatment that I have seen for this problem can be found in Martin Fowler's Masterpiece: Patterns of Enterprise Application Architecture. The two patterns you are going to be interested in reading are: Optimistic Offline Lock and Pessimistic Offline Lock. The best advice that I can give you is to pick up a copy of this book.
 
Geeta Ramasami
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For record locking mechanism, u can use isolation levels.The isolation level called TRNSACTION_SERIALIZABLE would take care of locking mechanism so that it wud prevent dirty reads and phantom reads.
Since this incurs some resource overhead u can go in for optimistic or pessimistic locking.
Cheers
Geeta
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!