What are object pooling and connection pooling and difference?
Answer Posted / ritesh
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.)
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Explain me what is the .net framework and how does it work?
Describe session handling in a webform, how does it work and what are the limitations?
What is the difference between web application and enterprise application?
Explain the garbage collection process?
What is different between webusercontrol and in webcustomcontrol?
Explain about the Common Language Runtime?
Explain what do the terms “boxing” and “unboxing” mean?
State the various features present in .NET?
Explain what is an application domain?
What method do you use to explicitly kill a users session? How?
What are the new features in .net core?
Explain me difference between public and static modifiers?
What are the improvements made in cas in .net 4.0?
How many types of generations are there in a garbage collector?
Explain the difference between garbage collections in .net 4.0 and earlier versions?