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

J

jmzl666

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.stringManager.GetString(
"userIdArgumentNullException",
CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(password)){
throw new
ArgumentNullException("password",General.stringManager.GetString(
"passwordArgumentNullException",
CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(domain)){
throw new
ArgumentNullException("domain",General.stringManager.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
 
G

Guest

Juan,
Not only is your post unrelated to the C# language, it's not even related to
ASP.NET - its about classic ASP. There is a newsgroup for that, but it's not
this one.
good luck!
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com



jmzl666 said:
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.stringManager.GetString(
"userIdArgumentNullException",
CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(password)){
throw new
ArgumentNullException("password",General.stringManager.GetString(
"passwordArgumentNullException",
CultureInfo.CurrentUICulture));
}
if(General.IsEmpty(domain)){
throw new
ArgumentNullException("domain",General.stringManager.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
 
J

Juan Zamudio

Peter said:
Juan,
Not only is your post unrelated to the C# language, it's not even related to
ASP.NET - its about classic ASP. There is a newsgroup for that, but it's not
this one.
good luck!
Peter
I thought because of the component being developed in C# maybe i could
get help here, what i was thinking, asking a question in a forum of C#
about a component developed in C#, silly me.

Juan Zamudio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top