Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More on cloning
Message
De
16/04/2013 13:56:57
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
More on cloning
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01571111
Message ID:
01571111
Vues:
71
Recently, I created a thread about cloning. This has resolved pretty much the issue I had when I had to reload the data dictionary in memory of a worker process without affecting another hit in progress.

Basically, I have this in my main App class:
        Public Shared oApp As Framework.App = New Framework.App()
Then, on the first hit of the worker process, oApp is properly initialized with a bunch of properties and objects.

Then, on each hit, I take a copy of it:
            oProcess.oApp = App.oApp.Clone()
Based on my first series of tests several weeks ago, this has proven to resolve the issue. So, while a hit is in progress, using oProcess.oApp pretty much everywhere, if another hit following that one is reseting App.oApp, this was not affecting the current hit in progress as it is a copy of the memory state at that time.

Well, recently, we put that in production, and despite all extensive tests, while this is pretty much perfect now, it is still not 100% perfect. I have faced that situation again that a hit in progress is loosing its oProcess.oApp because the next hit is reseting App.oApp.

I can see that the first hit was able to do several SQL commands. But, after several of them, it generated an error because of the next hit which reseted the App.oApp object, thus making the oProcess.oApp not being able to continue.

I thought this cloning approach would have resolved it for good. But, it seems more fine tuning is required. Is there anyone who can shed some light on this behavior so I can know what I have to adjust? Isn't Clone() a copy of the object state given to oProcess.oApp not able to affect any operation from another following hit on the same worker process, such as reinitializing App.oApp?

This is very strange. Before doing that cloning approach, I had that situation a lot. So, I finally had time to fine tune it. Even with a workload of tests, I wasn't able to simulate that situation after. But, once we hit production, while this is much better, it is still not perfect.

It is difficult to understand what is going on. If Clone() gives a copy of the object, how can a reset of the base object would make the copied object loose its state?
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform