Unit 6 Flashcards
Which of the following is true about a transaction?
It is a group of database operations that are combined into a logical unit.
By default, each SQL statement is treated as a separate transaction.
You can combine any number of SQL statements into a single transaction.
All of the above
A ________ occurs when neither of two transactions can be committed because they each have a lock on a resource needed by the other.
Deadlock
SQL Server’s lock manager always tries to lock resources
at the highest possible granularity
One of the drawbacks of using the SERIALIZABLE isolation level is
it can cause severe performance problems
By default, SQL Server is in autocommit mode. This means
unless you explicitly start a transaction using the BEGIN TRAN statement, each statement is automatically treated as a separate transaction
A lost update occurs when
two transactions select the same row and then update the row based on the values originally selected
Which statement can you use to explicitly start a transaction?
BEGIN TRAN
What does SQL Server automatically use to avoid some concurrency problems?
locks
If @@TRANCOUNT is equal to 1, then the COMMIT TRAN statement
decrements @@TRANCOUNT and commits the transaction
What kind of lock only allows one transaction to access a resource?
exclusive
If you don’t group statements into explicit transactions, SQL Server automatically treats each SQL statement as a separate what?
transaction
If you’ve declared save points, the COMMIT TRAN statement
commits the entire transaction
Which lock indicates that SQL Server plans to obtain a shared lock or an exclusive lock on a finer-grain resource?
intent lock
If neither of two transactions can be committed because they each have a lock on a resource needed by the other, it’s called
a deadlock
Which of the following is the default transaction isolation level for SQL Server?
READ COMMITTED