1

If I set the jdbc isolation level to read uncommitted in SQL Server, will SQL Server ever lock any tables, pages, rows etc?

Thanks.

5

Read uncommitted from Books Online:

Implements dirty read, or isolation level 0 locking, which means that no shared locks are issued and no exclusive locks are honored. When this option is set, it is possible to read uncommitted or dirty data; values in the data can be changed and rows can appear or disappear in the data set before the end of the transaction. This option has the same effect as setting NOLOCK on all tables in all SELECT statements in a transaction. This is the least restrictive of the four isolation levels.

So no it doesn't lock tables, rows or pages. However, any SELECT (even with READ UNCOMMITTED set) will issue a Sch-S (schema stability) lock, which basically means no schema changes can happen while the SELECT is executing (schema changes = add/drop column, change datatype of a column, change nullability of a column and a couple other operations I can't think of off the top of my head). A Sch-S lock should not interfere with DML statements (SELECT/INSERT/UPDATE/DELETE).

  • maybe add the link too? – gbn May 9 '12 at 14:24
  • Good catch, done. – Simon Righarts May 9 '12 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.