Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 4 Β· Quiz
Transactions and Concurrency
1. What happens in an application when two users edit the same record and both hit save without proper concurrency handling?
The app displays an error message to both users
The last write wins silently
Both changes are saved, causing data corruption
The first user's changes are lost
2. What is the purpose of adding a `rowversion` column in a database?
To store the last update time of a record
To serve as a concurrency token
To increase the performance of queries
To automatically rollback transactions
3. In what scenario would you need to use an explicit transaction with Entity Framework?
When there are multiple calls to SaveChanges
When executing raw SQL only
When there is no primary key defined
When saving records sequentially
4. Why is optimistic concurrency preferred over pessimistic locking in web applications?
It simplifies the locking mechanism
It prevents data loss
It avoids abandoned locks when a user closes their browser
It requires less database memory
Submit answers
Continue: Migrations in Prod and Raw SQL β
Review this lesson
Retake quiz