Deadlock

A deadlock can occur when two connections have blocked each other. For more information, see SQL Server Books Online.

Unlike Microsoft SQL Server, Microsoft SQL Server Compact 4.0 does not have deadlock detection. In SQL Server Compact 4.0, a deadlock is handled by using the lock time-out. If a transaction attempts to place a lock on a resource but cannot do so within the lock time-out, an error occurs. The lock time-out ensures that a transaction does not wait indefinitely for a resource held by another transaction. You can modify the lock time-out. For more information, see Lock Time-out.

If two transactions are involved in a deadlock, one of the transactions waiting for the resource times out and an error occurs. The transaction that times out is still active; it is not committed or rolled back. The other transaction then acquires the lock it requires and continues.

For more information, see SQL Server Books Online.

See Also

Concepts

Basics of Locking

Understanding Locking

Transaction Isolation Level

Locking Hints