What is the difference between optimistic and pessimistic locking?

Author Topic: What is the difference between optimistic and pessimistic locking?  (Read 985 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
Pessimistic is used when the user want to lock the records so that no one can update data. The user are only allowed to view the data.
In optimistic multiple user can update an view the data

Offline TomClarke

  • Trade Count: (0)
  • Hero Member
  • *****
  • Thank You 54
  • Posts: 837
  • Karma: 0
  • Gender: Male
    • Custom Writing Service & Content Marketplace
As for pessimistic locking: on updating the data, the record gets locked and no one else can access that record for updating. It becomes a read-only record till the lick is released. Once the lock gets released, the record can be locked again and get updated for a different user.
And optimistic locking: this allows multiple user to open up the same record for updating. Record gets locked only while updating the record. This is the most preffered way of locking for the web application.
Your ideas, our writings - Writology.com


Related Topics

  Subject / Started by Replies Last post
23 Replies
Last post 02-04-2012, 13:06:47
by dany
6 Replies
Last post 10-24-2011, 00:30:13
by Hogward
21 Replies
Last post 12-04-2016, 23:34:48
by annarichart
34 Replies
Last post 03-25-2014, 06:13:10
by parijatziw
1 Replies
Last post 12-24-2015, 22:18:23
by RH-Calvin