HighTechTalks DotNet Forums  

ASP 3.0 not releasing objects to pool (Windows 2003 Server)

Dotnet Framework (Component Services) microsoft.public.dotnet.framework.component_services


Discuss ASP 3.0 not releasing objects to pool (Windows 2003 Server) in the Dotnet Framework (Component Services) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jmzl666
 
Posts: n/a

Default ASP 3.0 not releasing objects to pool (Windows 2003 Server) - 07-31-2007 , 07:24 PM






Hi all, i have a COM+ component that works great from ASP.NET but in
ASP the objects are not released in Windows 2003, the same code runs
ok on my testing machine (Windows XP), I'm using the framework version
1.1.4322.573, every time i create an object the activated column in
the component services snap in adds one, but it never release it, here
is the code of my component.

[Guid("D22B554F-FE25-45af-B80C-80ACD8CE3DB6")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("CNBV_SAIT_AUTENTICA.ValidateUserServiced") ]
[ObjectPooling(MinPoolSize = 5,MaxPoolSize = 50)]
[JustInTimeActivation(true)]
[ComVisible(true)]
[EventTrackingEnabled(true)]
public class ValidateUserServiced: ServicedComponent,IValidateUser{
protected override bool CanBePooled() {
return(true);
}
[SecurityPermission(SecurityAction.Demand, ControlPrincipal=true,
UnmanagedCode=true)]
[AutoComplete(true)]
public bool IsValidD(string userId, string password,string domain){
if(General.IsEmpty(userId)){
throw new
ArgumentNullException("userId",General.stringManag er.GetString(
"userIdArgumentNullException", CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(password)){
throw new
ArgumentNullException("password",General.stringMan ager.GetString(
"passwordArgumentNullException", CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(domain)){
throw new
ArgumentNullException("domain",General.stringManag er.GetString(
"domainArgumentNullException", CultureInfo.CurrentUICulture));
}
IntPtr token= IntPtr.Zero;
try{
token= IntPtr.Zero;
if(!NativeMethods.LogOnUser(userId, General.GetDomain(domain),
password,
General.LOGON32_LOGON_INTERACTIVE,
General.LOGON32_PROVIDER_DEFAULT, ref token)){
return(false);
}
return(true);
}
finally{
if(!token.Equals(IntPtr.Zero)){
NativeMethods.CloseHandle(token);
}
}
}
}

Here is the code i use to call the component:

Public Function ValidaUsuario(usuario,password)
Dim ObjValida
on error resume next
Set
objValida=Server.CreateObject("CNBV_SAIT_AUTENTICA .ValidateUserServiced")
ValidaUsuario=objValida.IsValidDG(usuario, password,
Application("Dominio"),Application("Grupo"))
if Err.Number <> 0 then
ValidaUsuario = -3
Err.Clear
end if
set objValida=nothing
End Function

As you can see, I use JITA, autocomplete, on my machine this code runs
ok, but in windows 2003 the activated objects get to 50 and never go
down (application debugging is disabled in IIS), thanks in advanced.



Juan Zamudio


Reply With Quote
  #2  
Old   
Egil Hogholt
 
Posts: n/a

Default Re: ASP 3.0 not releasing objects to pool (Windows 2003 Server) - 08-03-2007 , 10:12 AM






"jmzl666" <jmzl666 (AT) gmail (DOT) com> wrote

Quote:
Hi all, i have a COM+ component that works great from ASP.NET but in
ASP the objects are not released in Windows 2003, the same code runs
ok on my testing machine (Windows XP), I'm using the framework version
1.1.4322.573, every time i create an object the activated column in
the component services snap in adds one, but it never release it, here
is the code of my component.
Try to add this in your finally block:
ContextUtil.DeactivateOnReturn = true; ContextUtil.SetComplete();

Cheers,
Egil
http://www.egilh.com/




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.