HEXAQ : A friendly question - answer site for IT professionals

Max pool size reached error with Microsoft Enterprise Library 5.0 Data Access Application Block (DAAB)


0

In my company we are using Visual Studio 2010, .Net Framework 4.0, Microsoft EntLib 5.0 and SQL Server 2008 R2.

Using EntLib DAAB we create our database connections.

We get "Max pool size reached" error more than many times a day on our website. Whenever we get this error on website, we stop and restart the Microsoft SQL Server service to resolve the error.

This solution works temporarily till our website is in testing mode but when we will make it live this will be a pressure point.

As far I know DAAB doesn't have any method to close or dispose database connection.

Is is possible to resolve the error by closing database connections or any other way?

Â
asked
 


≡ Total 3 Answers

0

In your connection string have you added Connect Timeout ?

Basically connect timeout plays a bigger role. If you don't set any value, it takes zero (0) by default. That causes each pooled connection to have maximum time-out.

When you define connect timeout in your asp.net project's connection string in web config file, you are forcing the connection to timeout within given seconds. i.e. if you specify Connect Timeout=45, the connection will be disposed after 45 seconds.

Â
replied


0

Try resetting your Internet Information Service(IIS).

Â
replied


0

Look at the below code excerpts, I am using it in my projects and I have never received the error as yours.

public DataSet UpdateCategory(categoryid, categoryname){    Database db = DatabaseFactory.CreateDatabase();    string sqlCommand = "UpdateCategory";    DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);    db.AddInParameter(dbCommandWrapper, "@categoryid", DbType.Int32, categoryid);    db.AddInParameter(dbCommandWrapper, "@categoryname", DbType.String, categoryname);    return db.ExecuteDataSet(dbCommandWrapper);}

DAAB itself manages connections so you don't need to do anything with connection.

Â
replied


Enter your reply here
Answer Preview:
Viewed: 2293 times
Asked on: 6/15/2013
Permalink
Topics in this question
  50
  10
c#
  24
  1
  1
Search Question
Similler Questions