What is the difference between Object pooling and connection Pooling ?
What is the difference between Object pooling and connection Pooling ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prabhu RajaPosted Oct 21, 2011, 5:48 AM
Object Pooling:
Object Pooling is something that tries to keep a pool of objects in memory to be re-used later and hence it will reduce the load of object creation to a great extent.
For Reference:
http://www.c-sharpcorner.com/UploadFile/chinnasrihari/3973/
What is connection pooling?
Connection pooling is process of taking a connection from a pool of connections, once connection is created in the pool any application can re-use that connection.
For reference :
http://www.c-sharpcorner.com/UploadFile/munnamax/connectionpooling08112007062332AM/connectionpooling.aspx
Javeed M ShaikhPosted Oct 20, 2011, 2:32 PM
Please refer to these articles from C# Corner:
http://www.c-sharpcorner.com/UploadFile/vmsanthosh.chn/109042007094154AM/1.aspx
http://www.c-sharpcorner.com/UploadFile/dsdaf/ConnPooling07262006093645AM/ConnPooling.aspx
The MSDN article is saying that its specific object pool implementation will increase the size of the pool up to the specified maximum. When the maximum is reached, unlike the example above, instead of throwing an exception, it makes the client wait until an object is returned to the pool, and then gives the newly returned object to the waiting client.
The MSDN article says that its specific connection pool implementation does not have a maximum size parameter - it will keep creating new connections to meet demand (eventually it will hit some system limit and the request will fail in some way that isn't specified).
Vipul KelkarPosted Oct 21, 2011, 10:26 AM
'call' did not literally mean calling the class :)
neways thanks vulpes..
VulpesPosted Oct 21, 2011, 10:16 AM
Yes, what you say about HTTPApplicationFactory is correct but I don't think you can call it directly in your code - it's called by the runtime.
Vipul KelkarPosted Oct 21, 2011, 10:01 AM
Vipul KelkarPosted Oct 21, 2011, 9:04 AM
so in that case we can call HTTPApplicationFactory as a pool of HTTPApplication objects which assigns an HTTPAPplication object to each incoming request ?
Satyapriya NayakPosted Oct 21, 2011, 12:37 AM
Object pooling is a COM+ service that enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the pool. When the object is deactivated, it is placed back into the pool to await the next request. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.EnterpriseServices.ServicedComponent class.
Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached.
Connection pooling increases the performance of the applications by reusing the active database connections instead of create new connection for every request.
Connection pooling Behaviour is controlled by the connection string parameters.
Follwing the the 4 parameters that control most of the connection pooling behaviour.
1. Connect Timeout
2. Max Pool Size
3. Min Pool Size
4. Pooling
Following are important differences between object pooling and connection pooling:
Creation. When using connection pooling, creation is on the same thread, so if there is nothing in the pool, a connection is created on your behalf. With object pooling, the pool might decide to create a new object. However, if you have already reached your maximum, it instead gives you the next available object. This is crucial behavior when it takes a long time to create an object, but you do not use it for very long.
Enforcement of minimums and maximums. This is not done in connection pooling. The maximum value in object pooling is very important when trying to scale your application. You might need to multiplex thousands of requests to just a few objects. (TPC/C benchmarks rely on this.)
COM+ object pooling is identical to what is used in .NET Framework managed SQL Client connection pooling. For example, creation is on a different thread and minimums and maximums are enforced.
Thanks
VulpesPosted Oct 20, 2011, 2:32 PM