开发者

Enterprise Library 5.0 and Connection management

开发者 https://www.devze.com 2023-02-21 17:39 出处:网络
Am working on a enterprise application where multiple clients will work on the system. Used three tier architecture and in database layer we are using enterprise library 5 for all the database 开发者_

Am working on a enterprise application where multiple clients will work on the system. Used three tier architecture and in database layer we are using enterprise library 5 for all the database 开发者_如何学Gooperation. I have declared a class level variable like this :-

SqlDatabase sqldtabase = 
    EnterpriseLibraryContainer.Current.GetInstance<SqlDatabase>("Beta");

and we are using sqldatabase variable for retrieving data from db and calling various Sp.

My query is how enterprise library does connection management and how it does connection pooling as well. Do we need to explicitly open or close connection or enterprise library take care of it.


If you're using ExecuteReader, for example, you'll need to explicitly close the connection.

You can change the pool size, for example set the max size in the web.config. The actual management is controlled by SQL Server.

Do you have some example code that you're not sure about?

0

精彩评论

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