Could you explain pessimistic locking?

Technology CommunityCategory: Entity FrameworkCould you explain pessimistic locking?
VietMX Staff asked 3 years ago

Pessimistic Locking is when you lock the record for your exclusive use until you have finished with it. It has much better integrity than optimistic locking but requires you to be careful with your application design to avoid Deadlocks. To use pessimistic locking you need either a direct connection to the database (as would typically be the case in a two tier client server application) or an externally available transaction ID that can be used independently of the connection.