473,772 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application lock state during Application start

APA
In the Application_Sta rt event I load several static variables with data from the database that are critical to the execution of the application.
My question is that during app start if a second request comes in before app start is complete does it wait for app start to complete or does it go
straight to BeginRequest? It appears in some cases that begin request is being called before app start is finished. We know this because we test for
this static variable being null in BeginRequest. So, do I need to do Application.Loc k() and Application.UnL ock() in Application_OnS tart to prevent
any requests from being processed until app start is complete? I would have thought that the default behavior would be to lock the application until
it is started.

Thx.
Jan 20 '07 #1
1 1877
APA,
I doubt that employing the Application.Loc k / Unlock methods would
accomplish your objective, as all they do is prevent modification of
Application objects by another thread until the Unlock method has completed.
Probably a safer and more reliable operation would be to figure out a way to
sleep a ver early Request until it can definitively gain access to non-null
static variables that you were setting in your Application_Sta rt event.
I haven't got much background in this area and would defer to others who
have better ideas, but in the worst case scenario, you could abort a Request
that is not able to get access to the static variables by throwing an
appropriate exception, causing the user to have to try again.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"APA" wrote:
In the Application_Sta rt event I load several static variables with data from the database that are critical to the execution of the application.
My question is that during app start if a second request comes in before app start is complete does it wait for app start to complete or does it go
straight to BeginRequest? It appears in some cases that begin request is being called before app start is finished. We know this because we test for
this static variable being null in BeginRequest. So, do I need to do Application.Loc k() and Application.UnL ock() in Application_OnS tart to prevent
any requests from being processed until app start is complete? I would have thought that the default behavior would be to lock the application until
it is started.

Thx.
Jan 21 '07 #2

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

Similar topics

0
1231
by: Mustafa Demirhan | last post by:
Hello, I am trying to add Python scripting support to one of my applications and I really need some help regarding the thread terminations. The application is a multi-threaded Windows application and multiple threads need to run Python code from time to time. Everything works fine when all the threads operate without any errors. Each thread creates a thread state, acquires the global lock, call the Python files and then release the...
12
2953
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the process name is the same, but the handle I need to retrive is the one from the final window and not the...
2
2013
by: Mel | last post by:
This may be a stupid question, but here goes... I have created a NameValueCollection in my website's application state. If, during a page request, I add a string key and string value to the collection, how are they stored? Strings are objects so I'm really only passing references, right? Now I assume that request handlers run in different threads with their own memory spaces, and when the request ends, the memory space is unaloted,...
3
1922
by: SL | last post by:
All, As I understand it, a single application (i.e. IIS virtual directory) in ASP.NET may in fact have more than one corresponding HttpApplicationState object (more or less one per server thread, I think). During each request, only one of these objects is exposed to the page as Page.Application. This seems to be supported by the fact that when I use the debugger, I can see the Application_Start event firing more than one time even...
8
6508
by: TrtnJohn | last post by:
I have an application where I would like to block waiting on an asynchronous event and still process messages. I can implement a hard loop to block such as: Do While StillWaiting Application.DoEvents Loop In this case the asynchronous thread can just set StillWaiting=False when complete.
4
1250
by: John Cosmas | last post by:
I need to execute some threads that load items into my APPLICATION object. I haven't figured out how to do that when I fire off a thread on a page, that takes its time and loads data into the APPLICATION level object which will be used later. Here is an example code I've used to fire it off. Dim pclsUserServices As clsUserServices = New clsUserServices Dim pobjUserServices As Thread pobjThread100 = New Thread(New ThreadStart(AddressOf...
22
3247
by: roadrunner | last post by:
Hi, Our website has recently been experiencing some problems under load. We have pinpointed a particular function which slows dramatically when we have these problems. Normally it should execute in under a second but it rises to about one minute under duress. The code is fairly straight forward with no calls to databases or any other servers. The only dubious thing I can see is that it retrieves several arrays from the Application...
4
4531
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst child apps of an IIS application and can be used by multiple users during the application life cycle and for multiple page loads for the same or different page under a root application. What I don't understand and need to know is whether that...
0
3301
by: coopdog | last post by:
This is a new issue as of an install to sp1 on vb express 2005. When I publish the application to my drive then I try to install it is wants to be installed from the same location as it was originally install. Any help would be great it is a real pain having to uninstall then install this update. Also all users are admins. Thanks Mike
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8934
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
7460
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
6713
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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.