Friday, January 20, 2006

You put it where?

As I alluded to earlier, I've been doing a lot of QA work at work helping to get a replacement module I've written out into the world. It's been a lot of sitting and staring and numbers and error logs. Nothing new there...

The module itself is in ATL COM+ to fit in with the rest of the product. My test app, however, is in C# .NET 1.1. During my testing I had these odd hangs and crashes of the test app (caught and reported) that I was chasing. The first had to do with me overwhelming my Dell laptop and SQL server, some cool down code and SQL memory tweaks fixed that one. This last one led me to an interesting set of changes.

The test program had been reporting a "SQL Timeout" but there was nothing in the logs about any type of SQL error. So I eventually remember to look at the SQL Connections, and sure enough my test programs were ramping them up to infinity.

The fun part of that statement is that my test programs were doing this by ignoring the ADODB.Recordset that was being returned. Yes, you read that right. The ATL object is returning a Recordset that the C# program isn't using, doesn't put into an object, never touches. I would have thought it would be instantly garbage collected, but I was wrong.

It seems that you have to catch the return value, close it, and mark it cleanable (set to null was sufficient) to get DotNet 1.1 to clean it up. After that, works as expected.... mostly. The ramping connections made it very fast, now it slogs along.

There's always something to fix... lol.

Technorati Tags: ,

No comments: