DB Connection Pool error after migrating to W2008

Discussion in 'Windows / IIS' started by misdescuentos, Sep 20, 2010.

  1. We migrated to W2008 yesterday. We did some test online and everything seems to work fine.

    Today we found that a lot of exception occurred, all related to the database connection:
    Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

    The db connection pool size is 100.

    Even though we haven't made any change to the source code nor the app configuration, how is this possible ?

    The only clue we have is that we are not closing the connections immediately after they are used. Instead we are using the using clause in a SqlDataReader (which I think only close the connection when the GC collectes the instance).

    Is it possible that this is happening because the W2008 has a 200MB memory pool (against 100MB of the W2003) so the GC is not being called, leaving the used connections opened ?

    Thanks in advance.
     
  2. The using clause should destroy the object upon completion of the block. But the reader is just a reader. Use the using clause on the connection instead.
     

Share This Page