473,704 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serializing a request for an ASP page containing COM objects

Max
Due to the behaviour of a particular COM object, I need to ensure that a
request for a particular ASP page is finalized before another request for
the page is processed. Does IIS have a way to ensure that subsequent
requests will be queued until the current request is completed?

If not, can IIS be configured to use seperate processes to satisfy requests
for a nominated ASP page?

Thanks in advance.

Max
Aug 1 '06 #1
47 3102

Max wrote:
Due to the behaviour of a particular COM object, I need to ensure that a
request for a particular ASP page is finalized before another request for
the page is processed. Does IIS have a way to ensure that subsequent
requests will be queued until the current request is completed?

If not, can IIS be configured to use seperate processes to satisfy requests
for a nominated ASP page?
As far as I'm aware, you can only specify process isolation on a
per-application basis. This procedure varies with the version of IIS
you're using.

Here's the procedure for version 6 (my version):
http://www.microsoft.com/technet/pro....mspx?mfr=true

Aug 1 '06 #2

"Max" <ng*****@pfxcor p.comwrote in message
news:44******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Due to the behaviour of a particular COM object, I need to ensure that a
request for a particular ASP page is finalized before another request for
the page is processed. Does IIS have a way to ensure that subsequent
requests will be queued until the current request is completed?

If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?

Thanks in advance.
Hi Max, as long as you don't have more web servers that serve the same
website (ie url like www.yoursite.com) you can lock your page, through a
Mutex object.
A mutex, enables multiple processes on the same machine to synced single
access to a single event.

Aug 1 '06 #3
Max wrote:
Due to the behaviour of a particular COM object, I need to ensure
that a request for a particular ASP page is finalized before another
request for the page is processed. Does IIS have a way to ensure that
subsequent requests will be queued until the current request is
completed?
If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?
If the object is not free-threaded, storing it in Application may accomplish
your goal. This is the reason we constantly advise against storing ADO
objects (such as Connections) in Application: they are apartment-threaded so
they can only service one thread at a time, in effect serializing all uses
of the object.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 1 '06 #4

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:Oh******** ******@TK2MSFTN GP03.phx.gbl...
Max wrote:
Due to the behaviour of a particular COM object, I need to ensure
that a request for a particular ASP page is finalized before another
request for the page is processed. Does IIS have a way to ensure that
subsequent requests will be queued until the current request is
completed?
If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?
If the object is not free-threaded, storing it in Application may
accomplish
your goal. This is the reason we constantly advise against storing ADO
objects (such as Connections) in Application: they are apartment-threaded
so
they can only service one thread at a time, in effect serializing all uses
of the object.
It's a nice idea but the application object simply disallows
apartment-threaded objects.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Aug 1 '06 #5

"Bobbo" <ro******@gmail .comwrote in message
news:11******** *************@7 5g2000cwc.googl egroups.com...
>
Max wrote:
Due to the behaviour of a particular COM object, I need to ensure that a
request for a particular ASP page is finalized before another request
for
the page is processed. Does IIS have a way to ensure that subsequent
requests will be queued until the current request is completed?

If not, can IIS be configured to use seperate processes to satisfy
requests
for a nominated ASP page?

As far as I'm aware, you can only specify process isolation on a
per-application basis. This procedure varies with the version of IIS
you're using.

Here's the procedure for version 6 (my version):
http://www.microsoft.com/technet/pro....mspx?mfr=true
>
On it's own it doesn't help serialise access to the page. It may be
possible to tweak the application metadata to allow only one worker thread
then only one request into the application can be processed at a time.

One approach might be to enable debugging. That limits the app to a single
thread but care needs to be taken that any configured debugger doesn't block
operation (e.g. Dr Watson style debugging is ok but script debugger will
just hang the process if there is an error).

If there is only one CPU then setting AspProcessorThr eadMax to 1 might also
do it.

Anthony.
Aug 1 '06 #6
Anthony Jones wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:Oh******** ******@TK2MSFTN GP03.phx.gbl...
>Max wrote:
>>Due to the behaviour of a particular COM object, I need to ensure
that a request for a particular ASP page is finalized before another
request for the page is processed. Does IIS have a way to ensure
that subsequent requests will be queued until the current request is
completed?
If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?
If the object is not free-threaded, storing it in Application may
accomplish your goal. This is the reason we constantly advise
against storing ADO objects (such as Connections) in Application:
they are apartment-threaded so they can only service one thread at a
time, in effect serializing all uses of the object.

It's a nice idea but the application object simply disallows
apartment-threaded objects.

I'm not sure I'm following your point. Could you expand on what you mean by
"disallows" ?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 1 '06 #7
Max wrote:
Due to the behaviour of a particular COM object, I need to ensure that a
request for a particular ASP page is finalized before another request for
the page is processed. Does IIS have a way to ensure that subsequent
requests will be queued until the current request is completed?
If not, can IIS be configured to use seperate processes to satisfy requests
for a nominated ASP page?
Max
Use the Application.Loc k and Application.Unl ock methods:
....
Application.Loc k
....
'Critical section of code.
....
Application.Unl ock
....

While there may be several copies of that page executing, the lock
ensures that only one is be executing the critical section of code at
any time. If a page finds the Application object locked, it will wait.

It isn't necessary to store anything in the Application object. You're
merely using the Application object's methods as a mutex to enforce
serialized access to the critical section of code.

Of course, serializing access will result in queuing and will slow
response. So minimize the time and resources utilized in the critical
section of code, enter it as late as possible and exit it as soon as
possible.
Aug 2 '06 #8
Max

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Anthony Jones wrote:
>"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:Oh******* *******@TK2MSFT NGP03.phx.gbl.. .
>>Max wrote:
Due to the behaviour of a particular COM object, I need to ensure
that a request for a particular ASP page is finalized before another
request for the page is processed. Does IIS have a way to ensure
that subsequent requests will be queued until the current request is
completed?
If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?

If the object is not free-threaded, storing it in Application may
accomplish your goal. This is the reason we constantly advise
against storing ADO objects (such as Connections) in Application:
they are apartment-threaded so they can only service one thread at a
time, in effect serializing all uses of the object.

It's a nice idea but the application object simply disallows
apartment-threaded objects.

I'm not sure I'm following your point. Could you expand on what you mean
by "disallows" ?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
My thanks to Bobbo, Anthony, Egbert and Bob for their input.

Unfortunately I may have some input on the setup of our clients web server
but not on the machine it runs on. As I cannot guarantee a single
processor, I cannot use your "set AspProcessorThr eadMax to 1" suggestion.

I am still looking at the suggestion to enable debugging although the
possibility of the process just hanging on the customers site would not be
acceptable.

I am interested in Anthonys suggestion to "tweak the application metadata to
allow only one worker thread" but am not sure which metadata values I would
need to set to accomplish this.

The COM object that I am using is marked as single threaded and doesn't
appear to have any protection when IIS makes overlapping requests for the
ASP page using it. We may be able to use a mutex but performance would be an
issue.

I have been looking into the use of a web garden (in IIS6) which appears to
offer multiple processes on the same application. Do you think that using a
web garden would be useful in this situation? Perhaps in combination with
allowing only one worker thread as suggested by Anthony?

Thanks in advance,

Max
Aug 2 '06 #9

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Anthony Jones wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:Oh******** ******@TK2MSFTN GP03.phx.gbl...
Max wrote:
Due to the behaviour of a particular COM object, I need to ensure
that a request for a particular ASP page is finalized before another
request for the page is processed. Does IIS have a way to ensure
that subsequent requests will be queued until the current request is
completed?
If not, can IIS be configured to use seperate processes to satisfy
requests for a nominated ASP page?

If the object is not free-threaded, storing it in Application may
accomplish your goal. This is the reason we constantly advise
against storing ADO objects (such as Connections) in Application:
they are apartment-threaded so they can only service one thread at a
time, in effect serializing all uses of the object.
It's a nice idea but the application object simply disallows
apartment-threaded objects.
I'm not sure I'm following your point. Could you expand on what you mean
by
"disallows" ?
<%

Dim o: Set o = Server.CreateOb ject("MSXML2.DO MDocument.3.0")

Set Application("x" ) = o

%>

ASP just errors saying that assigning this sort of object into the
application object is disallowed.
You can only assign free-threaded objects into the application object.

Assigning into the session is allowed but that will affiliate the session ID
with a thread and all requests containing that session cookie will only ever
be serviced be the affiliated thread (this doesn't help in the OP's case).
Over time this will mean requests will queue up to be serviced even though
worker threads are available because their affiliated thread is busy with
another request. What's really annoying is that even if the object
reference is only fleeting stored in the session object and then removed the
thread will still remain affiliated.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Aug 2 '06 #10

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

Similar topics

2
3519
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: + More ways to contact me __________________________________________________________________
0
9135
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8977
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6605
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5931
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4439
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2483
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2080
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.