Re: does an Sqlconnection object get shared at application level?

Discussion in 'ASP .Net' started by Nick, Jun 27, 2003.

  1. Nick

    Nick Guest

    thanks Paul, I did not think tht a variable would be shared
    application wide just because it was declared as static. I figured it
    would be session wide, or "Per user instance". this is good to know
    thanks Again

    On Thu, 26 Jun 2003 22:51:09 -0400, "Paul Wilson [MVP]"
    <> wrote:

    That's exactly what static means -- its a global variable shared by
    any and
    all.
    You should use session variables if you want something unique to a
    user
    session.

    Anyhow, database connections should never be put into session or
    statics.
    You should instead open a connection when you need it and close it
    fast too.
    This simply releases it to the pool, so its very efficient and it
    avoids
    contention.

    Thanks, Paul Wilson (MVP)
    Nick, Jun 27, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Douglass Turner
    Replies:
    2
    Views:
    2,015
    Manfred Bartz
    Sep 4, 2003
  2. pratham
    Replies:
    3
    Views:
    684
    sloan
    Aug 31, 2006
  3. pabbu
    Replies:
    8
    Views:
    710
    Marc Boyer
    Nov 7, 2005
  4. tropos
    Replies:
    3
    Views:
    449
  5. Jéjé
    Replies:
    0
    Views:
    222
    Jéjé
    Sep 27, 2005
Loading...

Share This Page