开发者

connection pooling problem in asp.net

开发者 https://www.devze.com 2023-02-15 05:41 出处:网络
i am getting connection pooling error for my asp.net (3.5) application when deployed to the clients开发者_如何转开发 server. using a query (from googling) i found out one of my pages alone pumping aro

i am getting connection pooling error for my asp.net (3.5) application when deployed to the clients开发者_如何转开发 server. using a query (from googling) i found out one of my pages alone pumping around 56 connections to the server when it is opened, the page contains a nested gridview and it is having quite a large number of data around 2600 main grid data and n number of data in the child grid, the database in the client is sql server 2000 , what will be max connection pool setting in the web config , is there a way to overcome this problem.


As @Mitch correcting pointed out, the better solution is not to adjust connection pooling setting up rather re-design your code so that it can work with single connection.

Current obvious issue is that every connection that you open should be closed immediately after your use them. But more than that you should consider below re-factoring:

  1. Try using single connection to get data for main grid and child grids. You might be firing multiple queries (resulting in multiple database trips).
  2. Next obvious step would be to fire multiple queries together or call to single sp that would fetch data for main grid and child grids together so that you reduce database trips to one.
  3. Next obvious step would to question if you need all this data together - for example, are you really planning to show 2600 rows at one time? If not then only fetch what you intend to show using database side paging.
0

精彩评论

暂无评论...
验证码 换一张
取 消