开发者

Datasource Connection Pool?

On different sites it is written that, datasource maintain the connection pool. Yes i agree it will maintain the pool if we dont c开发者_运维知识库lose the connection once we are done with transaction. But generally we close the connection once we are done with transaction. So practically datasource will never have any connection to maintain the pool. Is this correct? It will be the scenario only when programmer forget to close the connection.Right?


The connection pool maintains open connections for a certain period of time and usually closes them after some time of inactivity. Forgetting to close a connection prevents it from being released back to the pool and later reused, that's why you should always close them. What is the question anyways?


Well, if this is MS .NET, as long as the connection string is identical, the web server will pool the connections automatically. This will occur even if you 'close' them, so it is very efficient.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜