R
ryan.d.rembaum
Hello,
I have an application in which all users are connecting to the same
database. I know that opening a connection is very resource, etc, and
that cetain classes in ADO.net support connection pooling, which is all
great.
What I am wondering is, if all users are accessing the same database
throughout the application, why not just open one connection to the
database during the Application_Start event and use that throughout all
the other pages. i.e. Assign the connection object to a global
(Application) variable. This way the resource needed to open the
connection would only be required once.
Does this cause problems? And if so what are they? I feel sure there
must be some trouble with this since I have not seen it recommended,
but am not sure.
Thanks!
Ryan
I have an application in which all users are connecting to the same
database. I know that opening a connection is very resource, etc, and
that cetain classes in ADO.net support connection pooling, which is all
great.
What I am wondering is, if all users are accessing the same database
throughout the application, why not just open one connection to the
database during the Application_Start event and use that throughout all
the other pages. i.e. Assign the connection object to a global
(Application) variable. This way the resource needed to open the
connection would only be required once.
Does this cause problems? And if so what are they? I feel sure there
must be some trouble with this since I have not seen it recommended,
but am not sure.
Thanks!
Ryan