473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

HttpApplication instance

I connect to myDataStore from different places but I really only need to
connect once when the application loads.

'Connect to database.
Dim myDataStore As IDataStore = New eBiz.SDK.Integration.DataStore
myDataStore .Connect(connStr)

Can I also store the IDataStore object in my HttpApplication instance. If
so, how? Also, how would I call myDataSore from other pages. Or should I say,
how do I then have access to myDataSore from other pages or classes.

Sincerely,

Stan Alex

Nov 18 '05 #1
3 1594
I suppose you could add a "public static IDataStore myDataStore;" to the
Global class in Global.asax.cs (or the equivalent in VB). Then from any page
you could reference it by typing Global.myDataStore.

However, I believe that this may not a good idea (not knowing anything about
the class), in that it disregards any possible threading issues.

Is it horribly expensive to instantiate a eBiz.SDK.Integration.DataStore?
How often do you need to use it? You might want to rethink your approach.

"Stanley Alex" wrote:
I connect to myDataStore from different places but I really only need to
connect once when the application loads.

'Connect to database.
Dim myDataStore As IDataStore = New eBiz.SDK.Integration.DataStore
myDataStore .Connect(connStr)

Can I also store the IDataStore object in my HttpApplication instance. If
so, how? Also, how would I call myDataSore from other pages. Or should I say,
how do I then have access to myDataSore from other pages or classes.

Sincerely,

Stan Alex

Nov 18 '05 #2
Hi Brad,

Thank you very much for your reply. Actually, I am using an SDK and I do not
know how expensive it is to keep recreating the object. But since you brought
it up, what were the possible threading issues that are disregarded?

Also, by what you are suggesting, just because this may be an object that
anyone who logs in will use, do not just assume that the correct answer is to
instantiate the object in Global.asax. Is this correct?

"Brad Quinn" wrote:
I suppose you could add a "public static IDataStore myDataStore;" to the
Global class in Global.asax.cs (or the equivalent in VB). Then from any page
you could reference it by typing Global.myDataStore.

However, I believe that this may not a good idea (not knowing anything about
the class), in that it disregards any possible threading issues.

Is it horribly expensive to instantiate a eBiz.SDK.Integration.DataStore?
How often do you need to use it? You might want to rethink your approach.

"Stanley Alex" wrote:
I connect to myDataStore from different places but I really only need to
connect once when the application loads.

'Connect to database.
Dim myDataStore As IDataStore = New eBiz.SDK.Integration.DataStore
myDataStore .Connect(connStr)

Can I also store the IDataStore object in my HttpApplication instance. If
so, how? Also, how would I call myDataSore from other pages. Or should I say,
how do I then have access to myDataSore from other pages or classes.

Sincerely,

Stan Alex

Nov 18 '05 #3
"Stanley Alex" <St*********@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
Hi Brad,

Thank you very much for your reply. Actually, I am using an SDK and I do not know how expensive it is to keep recreating the object. But since you brought it up, what were the possible threading issues that are disregarded?


The threading issues are simple: this will be one single object being used
by multiple page requests, from multiple users, all at the same time. Does
the object support this? Does the object perform proper synchronization such
that two requests making different calls to the object at the same time
don't interfere with each other?
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AinO | last post by:
Hi, - I've created a webservice in VS2003/c# wich relies heavily on cache. It has a cache manager wich loads resources (triggered by requests) and wich has also a built in timer wich triggers...
7
by: [Gauthier] | last post by:
Hello, I've a simple question: On a server that run multiple asp.net HttpApplication, is there any way with the asp.net framework to exchange data between different application? I basically...
4
by: sikander khan via .NET 247 | last post by:
hello all ! i know that there exists one to one relationship between HttpApplication instance and a request. My doubt is that instance associated with that request until session times out. i mean...
2
by: Breeto | last post by:
Can anyone please tell me why the following doesn't work... using System; using System.Web; namespace AspTests {
5
by: miha.valencic | last post by:
Hi! A while ago, I noticed that there are usually two instances of HttpApplication created within IIS (observed on WinXPPro). Why is that? Especially, since Application_Start handler is called...
2
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug...
0
by: Urs | last post by:
Hi The HttpApplication class instance goes unexpected away. In Global.asax, I checked the Appliaction_Load event and discovered, that this eventhandler is called even when another user is still...
4
by: Urs | last post by:
Two questions: 1) What possibly causes HttpApplication from being unloaded or recycled? 2) How can I prevent HttpApplication from being unloaded or recycled (to prevent loss of session state...)...
0
by: rbg | last post by:
Have a web application which uses Data Cache. I need to understand what happens when a new instance of the same web application is created for for serving concurrent clients. What happens when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.