T
Tom Pester
Hi,
I am using a datareader that has been filled with a whole table (select *
from table).
I am processing every record in a loop which takes some time (this is bad
design I know, but its good enough for now)
I think the default isolation level is "read committed" so during this
period no updates/deletes are possible.
Read committed is to strict for what I want so I rewrote the query like this
: select * from table (nolock).
Furthermore I found out that if an error occurs in the loop, so the
connection isnt closed, the locks are held on the table until the .net
garbage collecter kicks in.
My question is :
- Can I somehow change the default isolation level, in the connection string
for example?
- Is there a property in the ADO.NET command or datareader class that lets
me set this programmatically.
(I found the property isolationlevel but couldn't get it to work)
All the best,
Tom
I am using a datareader that has been filled with a whole table (select *
from table).
I am processing every record in a loop which takes some time (this is bad
design I know, but its good enough for now)
I think the default isolation level is "read committed" so during this
period no updates/deletes are possible.
Read committed is to strict for what I want so I rewrote the query like this
: select * from table (nolock).
Furthermore I found out that if an error occurs in the loop, so the
connection isnt closed, the locks are held on the table until the .net
garbage collecter kicks in.
My question is :
- Can I somehow change the default isolation level, in the connection string
for example?
- Is there a property in the ADO.NET command or datareader class that lets
me set this programmatically.
(I found the property isolationlevel but couldn't get it to work)
All the best,
Tom