Access database: How to set Isolation Level using System.Data.OleD

  • Thread starter Thread starter JorgeC
  • Start date Start date
J

JorgeC

Hello!
How can I set the connection Isolation level for a Access database using
System.Data.OleDb?

In old days ;) of Visual Basic 6 and ADO we had the IsolationLevel property
in the connection object.
But in ADO.NET System.Data.OleDb I can't find anything to set the isolation
level!!

So, does anyone know how to set this ?
Thanks for your help and attention.
Jorge C.
 
What are you trying to achieve--what problem you are trying to solve?
ADO.NET doesn't work the same way ADO did, so there are many things
that are missing. If you provide a use case scenario, someone can jump
in with advice on how to achieve your goal.

--Mary
 
Hi!
Im some situations I want to change IsolationLevel to ReadUncommited because
the columns(fields) I want won't be changed by the users that maybe updating
table A (lets call it table A).
We have many users reading some columns that won't be changed by those
update the records.
If I use ReadCommitted and someone is updating this record(or set or blocks)
those that are just trying to read the rows (some users don't even care that
the data may be dirty) will be blocked until the update operations are
finished.

Thanks.
Jorge C.
 
Jorge,
Im some situations I want to change IsolationLevel to ReadUncommited
because
the columns(fields) I want won't be changed by the users that maybe
updating
table A (lets call it table A).
We have many users reading some columns that won't be changed by those
update the records.
If I use ReadCommitted and someone is updating this record(or set or
blocks)
those that are just trying to read the rows (some users don't even care
that
the data may be dirty) will be blocked until the update operations are
finished.
That is why was realiszed that optimistic concurrency is mostly better then
pesimistic concurrency.

In your case I would use the basic features of ADONET where all columns are
checked at changes, instead of the TimeStamp method, which always tells that
there is a change instead if there was a change in one of the now changes
columns.

(There is enough about optimistic concurrency and pesimistic concurrency
written in books like from William Vaughn and on internet than that I start
giving you a deeper explanation here).

Cor
 
There are a few things you can do:

1. For result sets that you want to be read-only, create and save
SELECT queries (setting the Recordset Type to Snapshot) instead of
selecting data directly from the tables.

2. Don't select a bazillion rows for browsing -- fetch in
reasonably-sized batches. People can't view thousands of rows at once
anyway.

2. Keep all data modifications short. IOW, select only the row from
the table being changed. Access/Jet uses row-level locking, so you
shouldn't have blocking or concurrency issues unless two users are
concurrently modifying the same row at the same time.

--Mary
 
Back
Top