What are object pooling and connection pooling and difference?

Answer Posted / prasenjit

Opening a database connection is a resource intensive and
time consuming operation. Connection pooling increases the
performance of Web applications by reusing active database
connections instead of creating a new connection with every
request. Connection pool manager maintains a pool of open
database connections. When a new connection requests come
in, the pool manager checks if the pool contains any unused
connections and returns one if available. If all connections
currently in the pool are busy and the maximum pool size has
not been reached, the new connection is created and added to
the pool. When the pool reaches its maximum size all new
connection requests are being queued up until a connection
in the pool becomes available or the connection attempt
times out.

Object Pool

An Object Pool may be defined as a container of objects that
are ready for use. Lists of ready-to-be-used objects are
contained in this pool. Whenever a new request for an object
creation comes in, the request is served by allocating an
object from the pool. Therefore, it reduces the overhead of
creating and re-creating objects each time an object
creation is required. "An object pool is an object that
holds a list of other objects, ready to make them available
for use (to yet another object, probably). It does the
management work involved, like keeping track of which
objects are currently in use, how many objects the pool
holds, whether this number should be increased."

The biggest advantage of using Object Pooling is that it
minimizes the consumption of memory and the system's
resources by recycling and re-using objects as and when it
is needed and serving the request for new objects from the
pool of ready-to-be-used objects. The objects that the
application
is done with (the objects are no longer needed) are sent
back to the pool rather than destroying them from the memory.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are multicast delegates?

585


When we go for html server controls and when we go for web server controls?

543


What is the difference between function and stored procedure?

589


How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?

543


What is Event - Delegate? clear syntax for writing a event delegate

1558






Explain me what is a design pattern and what is it for?

585


Explain boxing and unboxing in .net.

573


Describe the difference between inline and code behind which is best in a loosely coupled solution?

2132


Explain the difference between static page and dynamic page?

555


What are situations when you register .NET assembly in GAC ?

650


Tell us what do the following acronyms in .net stand for: il, cil, msil, cli and jit?

526


Can you create instance of a class which has private constructor?

594


Is .net is a language?

568


How many types of generations are there in a garbage collector?

520


What is Ajax design pattern in .NET?

655