Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major mixup in two ASP.NET transactions
Message
From
03/09/2006 13:00:00
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150471
Message ID:
01150606
Views:
28
>I've not enough knowledge to say - but I don't think it's relevant. For what it's worth I knocked up a simple version of your design as I understand it. (C# sorry). Global.asax:
>< %@ Application Language="C#" % >
><object id="GO" runat="server" class="GlobalObject" scope="Application"/>
><script runat="server">
>   void  Application_BeginRequest(object sender, EventArgs e)
>    {
>        Application.Lock();
>        GO.SavedResponse = HttpContext.Current.Response;
>        GO.SavedRequest = HttpContext.Current.Request;
>
>        DataEntryPurchase dep = new DataEntryPurchase(GO);
>        dep.Log("BeginRequest");
>     }
>
>    void Application_EndRequest(object sender, EventArgs e)
>    {
>        DataEntryPurchase dep = new DataEntryPurchase(GO);
>        dep.Log("EndRequest");
>        Application.UnLock();
>    }
></script>
>
>Relevant classes:
>
>public class GlobalObject
>{
>    private HttpRequest _savedRequest;
>    private HttpResponse _savedResponse;
>
>    public HttpResponse ActualResponse
>    {
>        get{return HttpContext.Current.Response; }
>    }
>
>    public HttpRequest ActualRequest
>    {
>        get { return HttpContext.Current.Request; }
>    }
>
>    public HttpRequest SavedRequest
>    {
>        get { return _savedRequest; }
>        set { _savedRequest = value; }
>    }
>
>    public HttpResponse SavedResponse
>    {
>        get { return _savedResponse; }
>        set { _savedResponse = value; }
>    }
>}
>
>public class DataEntryPurchase
>{
>    private GlobalObject oFrame;
>    public DataEntryPurchase(GlobalObject o)
>    {
>        GO = o;
>    }
>    public void Log(string s)
>    {
>        GO.ActualResponse.Write(DateTime.Now.ToString() + ": " + s  );
>        GO.ActualResponse.Write("Saved: " +oFrame.SavedRequest.RawUrl) ;
>        GO.ActualResponse.Write("Actual: " + oFrame.ActualRequest.RawUrl);
>    }
>}
>
>but this does force requests to be queued and processed sequentially. Whether this would give acceptable performance will depend on the level of hits the site is expected to receive (but even if acceptable it wouldn't 'feel right' to me). I tested with a couple of different aspx's with just 'System.Threading.Thread.Sleep(10000);' in the Page_Load. Removing the lock code will also demonstrate the problem you currently have..
>
>Can I ask what other request specific info is held by your framework beyond the Reguest/Response objects ?

As you mentioned, the application lock wouldn't be acceptable. We are about at 8 hits a seconds per server. So, this would bring down the application in seconds. I also need to upsize not downsize as per what I had with WWWC. With WWWC, I had 5 instances running in parallel. So, one hit was processed simultaneously among others. We need to preserve that ability and move forward.

As far as the framework goes, we are talking at about 400k for this DLL file. I need to find a way to have its Initialize() method to fire at once. Then, we need to find a way to assure that each hit starts from the framework BeginRequest() but in its own environment. The framework BeginRequest(), the EndRequest() and the ErrorLog() methods would not work if the Initialize() method hasn't been called once. But, it has to be done only once as this initialization sequence is having a lot of things.

There are about 200 aspx files that rely on the global.asax setup. So, we cannot have any proprietary aspx code in the global.asax, such as you demonstrated in your example for the DataEntryPurchase page. I have two applications that are ready to be deployed. They both have over 200 aspx files and a lot of .vb files. If that could help, I could compile it all in one file, as far as the .vb files go. But, I am not sure it is relevant here as to know if in place complication is a factor here.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform