Partial resultsets -
11-14-2007
, 03:32 AM
Hi,
I would like to be able to retrieve a partial result set. For example,
suppose I am running 4 processes and each one hosts a single decoupled
provider. If I wanted to get a count of the instances I can do something
like:
ManagementScope s = new ...
ManagementPath p = new ...
ManagementClass c = new ...
coll = c.GetInstances();
int i = collection.Count;
This works fine until one of the processes has a problem and doesn't return
back to WMI. In that case the call coll.Count blocks indefinitely.
I can get around this with the following:
EnumerationOptions e = new EnumerationOptions();
e.TimeOut = new TimeSpan(0, 0, 1);
coll = c.GetInstances(null, e);
int i = 0;
try
{
int i = coll.Count;
}
catch(ManagementException) {}
This doesn't block indefintely, but it always returns 0, even though only
one of the host processes is having a problem. Is there a way to get a
partial resultset? Isn't there a way to retrieve the instances hosted by
the remaining healthy processes?
Thanks
Steven |