Pessimistic locking locks resources as they are acquired, holding the locks for the duration of the transaction. Pessimistic locking is more likely to cause deadlocks. A deadlock occurs with two transactions when each blocks access to resources needed by the other.
Optimistic locking assumes that conflicts between transactions are unlikely but might occur. Transactions are allowed to
execute without locking resources. The only time resources are checked for a conflict is when data changes are made. If a conflict
occurs, the transaction is rolled back.
Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.
Get Started
Comments
Leave a Comment