Solution to random error – “Column does not belong to table

Bloomberg Open Symbology – BSYM (Bloomberg open sources its Security Identifier Universe)
February 25, 2010
“LeadMyGoals” coverage on TV Channels
January 12, 2011

It has been pretty painful investigating this weird problem – “Column <ColumnName> does not belong to table Table” even though we have this column in the specified table. Sometime it is just throws error – “….table ‘Table'” when there is no such table ‘Table’ in  database.

After thorough investigation many experiments, we found that the root cause of this problem is Corrupted Database Connection Pool.

First reason could be some code is not closing the connection properly, and the other reason could be restarting IIS Server several times without cleaning up the connection pool.

One of the important fact is that just stopping IIS Server will not clean the connection pool. When you restart the IIS Server it will use the pool that was created earlier.

Finally the Solution options are:

1. Use ‘iisreset’ command every time you stop the IIS server
2. Walk through your code and make sure you are closing connection properly.
3. Use ‘Connection Lifetime’ property of connection pool if required.
4. Try to use ClearAllPools/ClearPool in appropriate application event

To learn more on this here are some good links:

* MSDN Connection Pool Lifeguard

* Nice and brief insight on Connection Pool

Cheers!

Be Sociable, Share!

5 Comments

  1. Anderson says:

    Great article, i had this wierd random problem with gerordial using slqdatareader and this solution suited me perfectly

  2. Uwe says:

    Found your posting via Google, having the same issue (but only on certain client machines) for a .NET 2.0 Windows Forms application, I’m now putting “ClearAllPools()” calls before functions that do a lot of SQL quieries to see whether it helps.

    • khader says:

      During that time, we also found some thing else. There was a leak in code, one of the connection wasn’t being released. Please go through the code quite thoroughly, I am hoping you will find some leak.
      Another alternative is to try Enterprise Library. It seems to be much more stable.
      Good luck!

  3. Name (required) says:

    I had the same problem, the solution: the password of the user´s sql expired. 🙂

Leave a Reply

Your email address will not be published.