Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Application[] storage issue

Reply
Thread Tools

Application[] storage issue

 
 
Curt tabor
Guest
Posts: n/a
 
      11-04-2005
Hello,

I am creating a dbConnection for use through out my application and
storing it in an Application variable. I am doing this in the
Application_Start event in the Global.asax file. The first time the app
is run and a page needs this variable, Application["connection"]
returns null. Subsequent calls to the application work fine. This only
happens on the first run. Is there a better way? Is this some sort of
bug?

Thanks

Curt

 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      11-04-2005
I'd have to see the code to know exactly what is wrong, but I'd
suggest not taking this approach. You don't want to share a connection
among multiple requests - it will eventually break in mysterious ways.

Open a new connection when you need one and close it as soon as you
are done. The runtime will take care of keeping things running
efficiently.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 4 Nov 2005 11:22:13 -0800, "Curt tabor" <(E-Mail Removed)> wrote:

>Hello,
>
>I am creating a dbConnection for use through out my application and
>storing it in an Application variable. I am doing this in the
>Application_Start event in the Global.asax file. The first time the app
>is run and a page needs this variable, Application["connection"]
>returns null. Subsequent calls to the application work fine. This only
>happens on the first run. Is there a better way? Is this some sort of
>bug?
>
>Thanks
>
>Curt


 
Reply With Quote
 
 
 
 
Curt tabor
Guest
Posts: n/a
 
      11-04-2005
OK. Thanks.

Curt

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Storage Issue (Basic Issue) Srini Java 11 06-01-2008 01:17 AM
Why is enterprise storage so much more expensive than personal storage? John Computer Support 4 03-17-2008 09:50 PM
How to access the external storage unit of storage router =?Utf-8?B?SWduYXRpdXM=?= Wireless Networking 4 11-06-2006 06:40 AM
Difference b/w storage class and storage class specifier sarathy C Programming 2 07-17-2006 05:06 PM
Major ActiveX Domain issue. NOT LOCAL PC ISSUE joe.valentine@gmail.com Computer Support 8 02-06-2006 09:03 PM



Advertisments