M Sach
M Sach

Reputation: 34424

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 close 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?

Upvotes: 0

Views: 2360

Answers (2)

M3NTA7
M3NTA7

Reputation: 1347

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.

Upvotes: 0

Otávio Décio
Otávio Décio

Reputation: 74290

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?

Upvotes: 2

Related Questions