Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Revisiting the global connection object
Message
De
28/04/2007 14:41:17
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Revisiting the global connection object
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01220816
Message ID:
01220816
Vues:
61
Recently, I adjusted my framework to create a connection object at every hit instead of using a global connection object. This was necessary because, sometimes, on simultaneous hits, an "Object not a reference" error message was generated. This was mostly happening when two users were accessing the Web site at the same time.

But, now that a connection object is created at every hit, this brings back the original problem of the VFPOleDb bug. The reason I created a global connection object was to avoid the creation of a connection object on each data access. The VFPOleDb provider is quite sensitive in such circumstance. So, when I decided to use a global connection object, this resolved the bug. But, two weeks ago, I decided to create a connection object for every hit. While this is not creating a connection object for each data access, it does in fact create a connection object at every hit making the VFPOleDb provider but to revisit us again on random basis but not as much as it used to be.

So, this is a no go as well.

However, using that approach, I do get less errors than the "Object not a reference" one when I was using a global connection object.

So, this brings me back to using a global connection object. But, I need to resolve the "Object not a reference" error which happens mostly on simultaneous hits. This happens because the same connection is used at the same time making the data provider completely confused. I was thinking of creating about 100 connections at the application startup and scan through them in rotation for every data access I need to execute. But, in order to do that, I need to have an identifier which would allow me to know which connection object I am using so I can skip to the next one for the upcoming data access request. I figure this would probably resolve that at 100%. The only problem is how to have some kind of locking mechanism to make sure that two simultaneous hits would end up with connection 46 and connection 47, for example. I cannot use a data lock mechanism as this detection has to come from data free process. I do not want to use something on disk either as this would be overkill. Any thoughts on the topic?
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