473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Thread safety in disconnected ADO.NET dataset

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
Nov 23 '05 #1
1 1712
Hi Navin,

Here is my opinion:

1) Is it not required to synchronize when searching data using Find,
Select
and GetChildRows methods?
No.
2) Is it not required to synchronize when reading data using from
returned
rows from above ?
No. I assume that you only need to read data of the rows returned, and
does not need to manipulate the Array object containing those rows.
3) When updating a row in a datatable, is it required to lock only
datatable
or the whole dataset ?
It does not matter. Just lock on a same object. Prefer a private one.
You seem to misunderstand a bit. Locking is to ensure no other thread
can acquire a lock on the same object at the same time - no matter what
the object is as long as it is a reference-type one.
4) Is ReaderWriterLock recommended in this disconnected scenario or
using
Monitor/lock is "good enough" ?
Monitor/lock is "good enough" in this case.

Regards,
Thi

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arthur Dzhelali | last post by:
I according to MSDN dataview and dataset are thread safe for read operations, but we run into this scenario. I just would like to see some comments on it. Aplication written in VB.NET it is an...
4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
1
by: Andrew | last post by:
I'm a long time VB6/ADO and Java developer new to ADO.NET. I'm trying to decide on best practices and I'd appreciate any assistance. I have one specific question and another more general...
12
by: Ricardo Pereira | last post by:
Hello all, I have a C# class (in this example, called A) that, in its constructor, starts a thread with a method of its own. That thread will be used to continuously check for one of its...
5
by: J | last post by:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here ip() If Not IsPostBack Then ...
2
by: Sky | last post by:
Hello, The books on C# I have read talk of using the DataSets in disconnected mode, and Adding/Removing/Updating records from it, and letting it handle all the updating on the Database in one...
5
by: Jason Shohet | last post by:
I have an asp.net app, and suddenly, I lose connection to the web server. I'd like a way -- if the update doesn't go thru, to 'cache' the changes to the dataset. Then the next time the user hits...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
2
by: Gabriel | last post by:
Hello, I'm looking for documentation with "Best Practice" for ASP.NET application In which case use Connected or Disconnected mode Typed dataset or not ? I didn'd find anything pertinent...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.