Re: Store SqlConnection in SessionVariable
From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 04/16/04
- Next message: Martin Dechev: "Re: Server Application Unavailable"
- Previous message: Patrice: "Re: Server.MapPath in Global.asax"
- In reply to: Rolf Gossen: "Store SqlConnection in SessionVariable"
- Next in thread: Rolf Gossen: "Re: Store SqlConnection in SessionVariable"
- Reply: Rolf Gossen: "Re: Store SqlConnection in SessionVariable"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Apr 2004 13:58:11 +0200
"Rolf Gossen" <rolf.gossen@gmx.de> wrote in message news:d30e195.0404160340.4df85abd@posting.google.com...
> Hello NG,
>
> sometimes I read: "Never store an SqlClient.SqlConnection in a Session
> Variable." But noone explains why. Is there anyone who can briefly
> summarize the main problems about this approach.
>
> Thanks in advance
> Rolf
If you store opened connections, then you might run out of connections
when the site is moderately busy.
If you close the connection as soon as possible, then the built-in
connection pooling will prevent this problem. Also the pooling
makes sure that new connections are made quickly, so there is
(almost?) no penalty in closing the connection.
In the COM+/ASP world there were even bigger problems with storing
(COM/COM+) objects in the session.
Hans Kesting
- Next message: Martin Dechev: "Re: Server Application Unavailable"
- Previous message: Patrice: "Re: Server.MapPath in Global.asax"
- In reply to: Rolf Gossen: "Store SqlConnection in SessionVariable"
- Next in thread: Rolf Gossen: "Re: Store SqlConnection in SessionVariable"
- Reply: Rolf Gossen: "Re: Store SqlConnection in SessionVariable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|