What is the difference between optimistic and pessimistic locking?

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

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 139
  • Karma: 0
    • No Addiction
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 15
  • Posts: 896
  • Karma: 0
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.


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
22 Replies
Last post 02-12-2016, 03:43:51
by ShreyaKoushik
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