473,486 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application Variable disappears. v2.0

I've migrated an application from VS 2003 to VS 2005. It worked fine in
2003; but I've been having issue in 2005. The latest is dealing with a
DataSet that I have as an Application Variable. It seems to disappear when
the users session times out. What really weird is that it works fine on my
development box; but flakes out on the server. I added a button to a dummy
webpage to reload the Application variable; but it still disappears after the
session timeout.

Could the DataSet in the application variable be a reference, and that when
the session that created that dataset times out that reference is now being
set to null. If so, how do I get arround that?

I am loading the dataset via a webservice; but the same webservice loads the
development box application data just fine. Yes, the web config files point
to the same url for the webservice.

Snippet of code from Global.asax.cs
protected void Assign_Standard_Data()
{
try
{
localhost.LnD_Hydraulic_General proxy = new
LnD_HydraulicApplication.localhost.LnD_Hydraulic_G eneral();
DataSet Standard_CDs = proxy.Get_STDCodes("VALID");

if (Standard_CDs != null)
{
Application["Standard_Data"] = Standard_CDs;
}
else
{
throw new Exception("Global:Assign_Standard_Data - Unable to access
STDCodes Database.");
}
}

catch (Exception error)
{
throw new Exception(error.ToString());
}
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["Support.Email"] = "Na**@location.com";
Assign_Standard_Data();
}

protected void Session_Start(Object sender, EventArgs e)
{
if (Application["Standard_Data"] == null)
{
Assign_Standard_Data();
}
}

Any help would be appreciated.

Feb 23 '06 #1
2 1232
Are you deploying to Win2003 server while developing on a non-Win2003
machine? If so it may be that the application worker processes have the
same timeout as you session does, and it appears that your application
variable is being destroyed by the session end while it is in fact timing
out at the same time.

"Frank_00001" <Fr********@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
I've migrated an application from VS 2003 to VS 2005. It worked fine in
2003; but I've been having issue in 2005. The latest is dealing with a
DataSet that I have as an Application Variable. It seems to disappear
when
the users session times out. What really weird is that it works fine on
my
development box; but flakes out on the server. I added a button to a
dummy
webpage to reload the Application variable; but it still disappears after
the
session timeout.

Could the DataSet in the application variable be a reference, and that
when
the session that created that dataset times out that reference is now
being
set to null. If so, how do I get arround that?

I am loading the dataset via a webservice; but the same webservice loads
the
development box application data just fine. Yes, the web config files
point
to the same url for the webservice.

Snippet of code from Global.asax.cs
protected void Assign_Standard_Data()
{
try
{
localhost.LnD_Hydraulic_General proxy = new
LnD_HydraulicApplication.localhost.LnD_Hydraulic_G eneral();
DataSet Standard_CDs = proxy.Get_STDCodes("VALID");

if (Standard_CDs != null)
{
Application["Standard_Data"] = Standard_CDs;
}
else
{
throw new Exception("Global:Assign_Standard_Data - Unable to access
STDCodes Database.");
}
}

catch (Exception error)
{
throw new Exception(error.ToString());
}
}

protected void Application_Start(Object sender, EventArgs e)
{
Application["Support.Email"] = "Na**@location.com";
Assign_Standard_Data();
}

protected void Session_Start(Object sender, EventArgs e)
{
if (Application["Standard_Data"] == null)
{
Assign_Standard_Data();
}
}

Any help would be appreciated.

Feb 23 '06 #2
> I've migrated an application from VS 2003 to VS 2005. It worked fine in
2003; but I've been having issue in 2005. The latest is dealing with a
DataSet that I have as an Application Variable. It seems to disappear
when
the users session times out. What really weird is that it works fine on
my
development box; but flakes out on the server. I added a button to a
dummy
webpage to reload the Application variable; but it still disappears after
the
session timeout.

Could the DataSet in the application variable be a reference, and that
when
the session that created that dataset times out that reference is now
being
set to null. If so, how do I get arround that


Probably, consider using Cache instead of Application. It is far more robust
and flexible in terms of paralel access to datasets and objects in general.

From the code, it seems that the Session_Start() section is just repeating
the Application_Start() - that should not be nessesary.

R-)

Feb 24 '06 #3

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

Similar topics

0
1386
by: Nick Jushchyshyn | last post by:
Having a really strange issue with IIS 6 where the session variable does not stay consistant. The first symptom was that database connections (which use a user entered name/PW stored in the...
2
1483
by: Todd | last post by:
Here's one that has been stumping people: I'm writing in ASPX with VB.NET On the login page I set the entered usename text to a session variable....
5
1558
by: Dabbler | last post by:
When I first start up an ASP.NET application with tracing enabled in web.config the first few pages show trace at bottom of the page but then at some point the pages return to normal with no trace...
13
5050
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
4
4073
by: vul | last post by:
I start the application with Application.Run(New MDIMain) in Sub Main. MDIMain is the mdi form which loads and then calls Login form. I'm using Application.Exit to terminate my VB 2005 application...
9
1915
by: NevilleDNZ | last post by:
Can anyone explain why "begin B: 123" prints, but 456 doesn't? $ /usr/bin/python2.3 x1x2.py begin A: Pre B: 123 456 begin B: 123 Traceback (most recent call last): File "x1x2.py", line 13,...
3
4134
by: rdemyan via AccessMonster.com | last post by:
Sometimes users (including myself) accidentally click on the application close icon in the application menu bar when they meant to just click on the 'X' for the form. Of course the app closes and...
1
2888
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I'm using VB2005 + Office XP Enterprise. If you create a Word.Application object, you risk a memory leak if your application crashes because Word.Application is an unmanaged COM Interop...
4
2721
by: macneed | last post by:
how can i declare a variable inside a if case? if(today != recordday) { string NewRecordOfToday; } .. other work... .. .. if(today != recordday)
0
7105
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,...
0
7132
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,...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7341
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...
0
5439
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,...
1
4870
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...
0
4564
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.