Home All Groups Group Topic Archive Search About

Newbie: ADO.NET and thread safety

Author
11 Nov 2005 6:57 PM
Navin Mishra
Hi,

  I've multiple related data tables in a disconnected dataset which could be
accessed by mutltiple threads to read and write data. The documentation says
that dataset and datatable are thread safe to read in multithreaded
environment but one needs to lock them to update. Questions:

1) Is it not required to synchronize when searching data using Find, Select
and GetChildRows methods ?
2) Is it not required to synchronize when reading data using from returned
rows from above ?
3) When updating a row in a datatable, is it required to lock only datatable
or the whole dataset ?
4) Is ReaderWriterLock recommended in this disconnected scenario or using
Monitor/lock is "good enough" ?

Thanks in advance and regards

Navin

Author
18 Nov 2005 1:52 PM
Navin Mishra
Response appreciated!

Thanks in advance and regards

Navin

Show quote
"Navin Mishra" <navin.mis***@siemens.com> wrote in message
news:%23IUnDHv5FHA.2600@tk2msftngp13.phx.gbl...
> Hi,
>
>   I've multiple related data tables in a disconnected dataset which could
be
> accessed by mutltiple threads to read and write data. The documentation
says
> that dataset and datatable are thread safe to read in multithreaded
> environment but one needs to lock them to update. Questions:
>
> 1) Is it not required to synchronize when searching data using Find,
Select
> and GetChildRows methods ?
> 2) Is it not required to synchronize when reading data using from returned
> rows from above ?
> 3) When updating a row in a datatable, is it required to lock only
datatable
> or the whole dataset ?
> 4) Is ReaderWriterLock recommended in this disconnected scenario or using
> Monitor/lock is "good enough" ?
>
> Thanks in advance and regards
>
> Navin
>
>

AddThis Social Bookmark Button