I ran into a very strange error tonight. I was working with web services
and typed datasets. The web server I was using happens to be on the
other end of a virtual network (Hamachi).
Everything was working fine. I added one more row of data to the table
and all of a sudden one web method started failing. I initially thought
the web service was timing out but after a while the following exception
was thrown:
The CLR has been unable to transition from COM context 0x1a2008 to COM
context 0x1a2178 for 60 seconds
I thought there might be some funny stuff going on since it was working
fine just moments ago. So, I rebooted both boxes, tried VS 2005 and
VS2003 on the client end. (VS2003 is running on the web server side.)
The client would not work remotely, but if I ran the client locally on
the server, it would work fine.
I was running out of ideas and decided to delete the last couple rows I
added from the database and everything started working again. Crazy. I
hope this doesn't happen in production -- can't really just delete
production rows to get something to work. (There was nothing odd about
the data, no SQL injection etc.)
I believe the line of code it was failing on (and hence the post in this
newsgroup) was in the web reference generated code:
protected override void ReadXmlSerializable(XmlReader reader) {
this.Reset();
DataSet ds = new DataSet();
ds.ReadXml(reader); // <------------ CRASH HERE
if ((ds.Tables["OrganizationList"] != null)) {
this.Tables.Add(new OrganizationListDataTable(ds.Tables
["OrganizationList"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
The fact that it was happening in both 2003 and 2005 makes me think
there is something going wrong in the XML stack somewhere, but that's
just a wild guess.
I thought I would post this incase other people get the same error. Good
luck!
--
Don Rixtown
don[dot]rixtown[at]gmail[dot]com