Re: Store SqlConnection in SessionVariable

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Patrice (nobody_at_nowhere.com)
Date: 04/16/04


Date: Fri, 16 Apr 2004 13:55:49 +0200

It forces each user to work its own connection. Instead the recommended
approach is AFAIK still to "create" a connection at the beginning of each
page and to release it after...

With the pooling feature provided by ADO.NET, when you "create" a connection
it is actually taken from a pool and returned to this pool when you
"destroy" it. With this approach "creating" a new connection is quick (as it
is actually taken from a pool) and x users can be serviced using a much
lower number of connections (as each user will "borrow" a connection from
the pool just during the period it really needs one).

Patrice

"Rolf Gossen" <rolf.gossen@gmx.de> a écrit dans le message de
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



Relevant Pages

  • Re: Close and Dispose argument
    ... > fact that even Microsoft is not clear on the issue. ... > connections from the pool is still a debate. ... > method removes the conneciton from the connection pool". ... > Your issue was forwarded to us here at Microsoft Courseware Support. ...
    (microsoft.public.dotnet.framework.adonet)
  • Close and Dispose argument
    ... here is an email conversation between me and Microsoft ... connections from the pool is still a debate. ... Programming with Microsoft ADO.NET" module 2, p 18: "Calling the Dispose ... method removes the conneciton from the connection pool". ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: MinPoolSize behaviour
    ... Min Pool Size, The first time you open a connection we will open the 1 ... > Is the pool created forever? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Q:Multithreaded ADO.Net Connections Are Non Pooled?
    ... different you get a new pool. ... > the process/app domain differences, does running on a thread created by ... If you're using SSPI, each connection must be ... >> connect to the SQL Server machine, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection pooling and changed password issue
    ... There is no "clear the pool" or "drop the pool" until ADO.NET 2.0. ... > Hi - so a previously made connection with the old credentials will still ... > "William Vaughn" wrote: ... >>> username/password then the connection pool will be used and the same ...
    (microsoft.public.dotnet.framework.adonet)