Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design issue with NameObjectCollectionBase
Message
 
À
27/09/2010 13:49:09
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01482903
Message ID:
01482904
Vues:
59
This message has been marked as the solution to the initial question of the thread.
>So, if I have 76 tables, the For/Next will be done 76 times to initialize Tables. So, during that phase, if two hits are simultaneous when the application starts, this can create a mess. So, I need to find a way to initialize into something private and only initialize oApp.Tables at the end such as:
>
>
>So, the goal is to make sure that the initialization of oApp.Tables is done private, by the use of a separate container, and only assign it in one shot at the end from one command. However, I am not sure how to do it. Because, this kind of container has to be declared Public.
>
>Any idea?

It sounds like you could just lock that section of code to keep it from running concurrently. In C# just wrap it in a lock { } statement. In VB.NET you'd use SyncLock (hope I have the syntax right), ex.
Private LockObject as New Object

SyncLock LockObject
' Code here
End SyncLock
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform