473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Server.Execute() and Application.Lock

Hi All

I am using Application.lock to protect a reference to a COM+ object while
calling Server.Execute() to another ASP page. I am doing this to pass the
object's reference to the other page, and I CAN'T rely on the session
object.

Is this a safe way to protect the object reference? i.e. does the
Application object remain locked when calling Server.Execute() ?

Help/advice will be greatly appreciated.

Thanks ahead

Elie Grouchko

**********************************

The code looks like that:

page1.asp
---------------------
dim ObjectRef
set ObjectRef = Server.CreateObject("Server.Object")
....
Application.Lock
set Application("reference") = ObjectRef
Server.Execute("page2.asp")
page2.asp
---------------------
dim ObjectRef
set ObjectRef=Application("reference")
set Application("reference") = nothing
Application.Unlock
Jul 19 '05 #1
2 2060
Elie,

The server.execute actually executes the page as if it were a part of the
page where it is executed. Kinda like "include." Therefore, the application
is locked for the application variables against any modification. If I were
you, I would just do the application lock and unlock on the same page, in
your case on the second one. The Application variables can be accessed but
only for readonly access.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Elie Grouchko" <eg*******@hotmail.com> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
Hi All

I am using Application.lock to protect a reference to a COM+ object while
calling Server.Execute() to another ASP page. I am doing this to pass the
object's reference to the other page, and I CAN'T rely on the session
object.

Is this a safe way to protect the object reference? i.e. does the
Application object remain locked when calling Server.Execute() ?

Help/advice will be greatly appreciated.

Thanks ahead

Elie Grouchko

**********************************

The code looks like that:

page1.asp
---------------------
dim ObjectRef
set ObjectRef = Server.CreateObject("Server.Object")
...
Application.Lock
set Application("reference") = ObjectRef
Server.Execute("page2.asp")
page2.asp
---------------------
dim ObjectRef
set ObjectRef=Application("reference")
set Application("reference") = nothing
Application.Unlock

Jul 19 '05 #2
Elie,

The server.execute actually executes the page as if it were a part of the
page where it is executed. Kinda like "include." Therefore, the application
is locked for the application variables against any modification. If I were
you, I would just do the application lock and unlock on the same page, in
your case on the second one. The Application variables can be accessed but
only for readonly access.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Elie Grouchko" <eg*******@hotmail.com> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
Hi All

I am using Application.lock to protect a reference to a COM+ object while
calling Server.Execute() to another ASP page. I am doing this to pass the
object's reference to the other page, and I CAN'T rely on the session
object.

Is this a safe way to protect the object reference? i.e. does the
Application object remain locked when calling Server.Execute() ?

Help/advice will be greatly appreciated.

Thanks ahead

Elie Grouchko

**********************************

The code looks like that:

page1.asp
---------------------
dim ObjectRef
set ObjectRef = Server.CreateObject("Server.Object")
...
Application.Lock
set Application("reference") = ObjectRef
Server.Execute("page2.asp")
page2.asp
---------------------
dim ObjectRef
set ObjectRef=Application("reference")
set Application("reference") = nothing
Application.Unlock

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Elie Grouchko | last post by:
Hi In Page1.asp I am calling Server.Execute("Page2.asp"). Before calling Server.Execute(), I set an application variable to a value that it is important for me to know that it doesn't get...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
6
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the...
0
by: Karl Bauer | last post by:
Hello! I have a strange problem: The aspx File for articles is saved in the root Folder of my asp.net application -> artikel.aspx It's like a template and in this page I use a Server.Execute to...
4
by: Gav | last post by:
Hi, I am writing a windows form application (C#) which access's data from an SQL server. The SQL server is using windows authentication only. At the moment I have to grant the domain users...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: Michael | last post by:
Question. Is it possible to run Server.execute command inside global.asa file. if it is where. Inside Application onstart? Another ideas appreciated. Michael
7
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.