Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2007, 07:07 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default Updating A Website While In Use

Over the years my experience has been exclusively VB (All flavors) and SQL Server client based corporate application development. I am now considering a web interface for future development and one thought occurred to me that I have not been able to find much information on:

Can a web application be safely updated while in use?

Example: My shipping department is in the middle of creating a bill of lading for 30 packlists worth of goods and I decide to update the entire program. What will happen to running processes if I update at this point?

Currently I use "Click Once" deployment for all client based applications so each user is actually running a local copy of the executable which allows me to update our system at will (a user only needs to restart a program to obtain the latest version).



Best Regards,
Earl Francis
__________________


Best Regards,
Earl
 
Old July 12th, 2007, 08:21 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Most of the answer here depends on your definition of "safely" and on how your application is built. The main factor to consider is how you use Session.

If application activity is driven by the database versus by in-memory data then you are much better off. When you update the site, pages will recompile. If you update the web.config then the whole app will reset and user session data will get tossed.

The ticket for forms authentication is stored as a cookie. If you use the ticket for user identification that links to the database, then the users may notice nothing more than a slight delay in the application while it's recompiling (and of course any actually changes to the application you have made).


As far as running processes go, a running page request *should* finish normally. When the request starts, all the application code is already loaded up so a change to the assemblies shouldn't affect the executing code. Of course, it would be best to schedule the update for a low/no activity time.

-Peter
 
Old July 12th, 2007, 08:39 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

I want to comment here, Peter, I tried the same, i.e. I uploaded the DLL when the client was actually working on the website, the whole page went down with errors like "Server error in application\ could not load assembly......"

So how is it possible to deploy the DLL while clients are browsing the website?

Regards
Mike

Don't expect too much, too soon.
 
Old July 12th, 2007, 08:50 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I guess there are just some limitations that you can't avoid. You'll have to architect the application to be able to recover from an application update. Consider the points I made and you should be able to work out most of the issues. At worse, a user might need to log back into the application.

-Peter
 
Old July 12th, 2007, 08:53 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

Thanks Peter.

 
Quote:
quote:If application activity is driven by the database versus by in-memory data then you are much better off.


For my own clarification, does your quote above refer to a SQL Server session state?



Best Regards,
Earl Francis
 
Old July 12th, 2007, 09:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

To make it easier to update files in a running site and to avoid locked files, consider adding a file called app_offline.htm to the root of your site. With this file in the root, the application domain will be shut down and won't be restarted for subsequent requests. Once you're done updating the site, simply remove the file again and things will continue normally. For more info:

http://weblogs.asp.net/scottgu/archi...09/442332.aspx

Peter's point about Session state makes a lot of sense. It means users can potentially loose session data they collected before the update. External state storage (a state server or SQL Server) should take care of the problem.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old July 12th, 2007, 04:23 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Earl,

When the app resets, the in-proc session data is lost. With SQL or state server session state, as Imar pointed out, it shouldn't be a problem as the session IS lives in the database and the user cookie. So then the noticable part would be the delay in application response.

Regarding my quote: I meant if you were storing data in your own database. I.e. if you had a database driven shopping cart, then you wouldn't lose the data. To extend this example, if the link to the database was a value in session you WOULD loose the link using in-proc session, but probably not with SQL/state server session. If the shopping cart ID was linked to the user thru a user login or a cookie (non the session cookie), then you shouldn't loose the link.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
all about website benny HTML Code Clinic 2 February 11th, 2008 04:49 AM
Dynamic website to Static website Aboal3ood ASP.NET 1.x and 2.0 Application Design 4 December 7th, 2006 11:46 AM
Updating an Existing Website to XHTML and CSS funksoulkitty HTML Code Clinic 2 April 3rd, 2006 05:51 PM
website using .net harrysingh26 Classic ASP Databases 0 October 3rd, 2005 05:24 AM
Security for website eapsokha Classic ASP Databases 1 February 16th, 2004 12:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.