Hour 14

Quiz Answers

1: What must be maintained when using the pessimistic concurrency approach?
  1. Locks on data resources

  2. Database connections

  3. Events

A1: a and b. Both locks on data resources and database connections must be maintained in pessimistic concurrency.
2: In general, how is optimistic concurrency implemented?
  1. Compare original values to current values in the data source

  2. Identify key changes, then commit updates

  3. Delete old values, then insert new values

A2: a. In general, you will need to compare original values (that you read from the data source) to current values in the data source before the data can be updated. If any of the comparison fails (indicating that the row was updated by someone else), you have encountered an optimistic concurrency ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.