Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Revisiting the global connection object
Message
From
28/04/2007 20:45:45
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/04/2007 14:41:17
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01220816
Message ID:
01220837
Views:
22
>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?

Can't you use a static array to keep them.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform