GetChanges hangs application

J

Jesper

I have an odd situation where calling GetChanges on my dataset randomly
hangs my application. It doesnt hang it every time, but I'd say more than
50% of the time. The changes to the data are actually minimal...its 1
property of 1 row changed in 1 datatable, though the dataset itself contains
more than 40 tables. And it seems random whether the exact same change will
hang it or not.

My dataset is a typed dataset, but I've tried typecasting it to a DataSet,
and that didnt make a difference. I have no problems calling GetChanges on
the individual datatables, so I've been able to get around it for now by
looping through the Tables collection and merging any tables with changes
into a new dataset, but I'm still a bit worried. Is ADO.NET really stabil
enough for a professional application? Have anyone had any similar
experiences.
 
M

Microsoft

Hi Sahil,

What is the issue with having 40 tables? Are there things I should look out
for in working with ADO.NET with a dataset like that?

There may be 40 tables but almost all of them have less than 20 rows of
data. The actual size of the data should not be a problem. But the
schema-size is?

Jesper.
 
S

Sahil Malik

Jesper,

It *really* depends.

And you can't ever say what is a good size to hold in a DataSet. It all
depends on the internal logic of what you might need to call.

When I start going to some significant size of a dataset - anything over 5
tables with lots of rows, or 10 tables with fewer rows is significant in my
opinion, I'd first run a few concept tests before basing my design on it.

It is easy to abuse a dataset as a database, but the truth of the matter is
that a dataset cannot be a database. 40 tables is much too many !!

I mean think about it, what kind of XML Schema will it take to represent 40
tables? Now imagine the poor DataSet object trying to juggle with that big
of an XML blob. As a comparison, just do a DomDocument.LoadXML on a schema
that represents 40 tables. . . if it goes to certain milliseconds, then if
any of those functions do something like that in a loop - your performance
will tank. .. Now loading Xml Schema in a loop is something that it might
not be doing, but who knows what the internal logic of GetChanges is?

Stay under 5 tables per dataset is my opinion, though this is _VERY VERY_
application and situation specific.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top