Forums » .NET » .NET »

Diff connection pooling and object pooling


Posted Date: 28 Apr 2005      Posted By:: Ajaysinh Chhatrasinh Mangrola Profile photo    Member Level: Bronze  Member Rank: 0     Points: 2   Responses: 3

What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?


Responses

#16777    Author: Kamliesh Nadar      Member Level: Gold      Member Rank: 0     Date: 28/Apr/2005   Rating: 2 out of 52 out of 5     Points: 2

Hi,

Object pools are software constructs designed to optimize the use of limited resources in order to meet the demands of client requests by "pooling" objects in a container and reusing these pooled objects as needed.

Connection pools are container-managed pools of connections to a database, directory-service, message-store, or other connection-oriented entity. Connection pools are usually implemented using some sort of object pool. So in that respect, connection pools are specific instances of object pools, however it is possible to implement a connection pool without using an object pool.


conn.ConnectionString = "integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Min Pool Size=5;Max Pool Size=60;Connect Timeout=2;"; // Notice Connection Timeout set to only two seconds!

conn.Open();


 
#16782    Author: Pankaj Kumar Pandey      Member Level: Gold      Member Rank: 0     Date: 28/Apr/2005   Rating: 2 out of 52 out of 5     Points: 2

Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached. 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.)


 
#18028    Author: Roopesh Rajendran      Member Level: Gold      Member Rank: 0     Date: 10/May/2005   Rating: 2 out of 52 out of 5     Points: 2

hai ,

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.
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





 
Post Reply     

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.





  • Return to Discussion Forum
  • Start new thread


  • Top Contributors
    Today
      Last 7 Daysmore...

      Awards & Gifts

      Online Members

      ArthurCrymn
      More...
       
      Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India