Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How do you do object pooling in .NET
How do you do object pooling in .NET ?
✍: Guest
COM+ reduces overhead by creating object from scratch. So in COM+ when object is activated
its activated from pool and when its deactivated it’s pushed back to the pool. Object pooling is
configures by using the “ObjectPoolingAttribute” to the class.
Note:- When a class is marked with objectpooling attribute it can not be inherited.
ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)> _
Public Class testingclass Inherits ServicedComponent Public Sub DoWork() ' Method contents go here. End Sub End Class
Above is a sample code which has the “ObjectPooling” attribute defined. Below is a sample code which uses the class.
Public Class App Overloads Public Shared Sub Main(args() As String) Dim xyz As New TestObjectPooling() xyz.doWork() ServicedComponent.DisposeObject (xyz) End Sub End Class
Above is a sample code which uses the object pooled object. Note the DisposeObject() This ensures its safe return to the object pool.
2007-10-22, 4892👍, 0💬
Popular Posts:
How to create arrays in JavaScript? We can declare an array like this var scripts = new Array(); We ...
How Do You Uninstall JUnit Uninstalling JUnit is easy. Just remember these: Delete the directory tha...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...
How To Escape Special Characters in SQL statements? - MySQL FAQs - Introduction to SQL Basics There ...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...