Question

I'm asking that because I created a windows service and it seem that under heavy load(which in my case when windows is booting up) the data inside the xml doesn't get loaded before I manually do stuff with it in my case is checking how many row are in a specific datatable inside that dataset.

Dataset got a schema.

Speudo code would be:

dataset.readxml("c:\myfile.xml")
if dataset.datatable1.rowcount is 1 
    do something
else
    do something else

In my case, it reach the else case even if there is one row.

If I start the service manually after, because the else case stop it, everything work fine.


If it's synchronous, what could cause that behavior?

Was it helpful?

Solution

Asynchronous methods in the .NET classes follows the the BeginSomeAction() / EndSomeAction() pattern, so my guess is that ReadXml() is synchronous. According to the documentation there's no BeginReadXml for DataSet.

EDIT: A quick browse through the implementation indicates a synchronous read, so unless there's something I have missed it supports my guess.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top