Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling first hit on a site
Message
From
27/09/2010 15:15:28
 
 
To
27/09/2010 15:05:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01482914
Message ID:
01482918
Views:
39
>I'm handling it using this code:
>
>
>public static class Bootstrapper
>    {
>        private static readonly object _lock = new object();
>        private static bool _initialized;
>
>        public static void Bootstrap()
>        {
>            if (!_initialized)
>            {
>                lock (_lock)
>                {
>                    if (!_initialized)
>                    {
>                        _initialized = true;
>
>                        StructureMapConfiguration.Initialize();
>
>                        var startupTasks = ObjectFactory.GetAllInstances<IStartupTask>();
>
>                        startupTasks.Each(task => task.Execute());
>                    }
>                }
>            }
>        }
>    }
>
>
>I call this in my Application_Start event in the global.asax file. Looks like we had the same concern, but I'm handling it a bit differently by checking the _initialized variable before and after the lock.

The reason I do not need to check it at first, before the lock, is because I have lFirstHit. So, basically, we have the same code.

Thanks
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