![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Don't bother. Just ensure you close and dispose your connections after every use, and let the connection-pool do its job. Closing a SqlConnection doesn't close the *actual* connection - it just releases it to the pool for re-use. Marc |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
in asp.net? that means that every request is going to be trying to use *the same* connection. Not even "MARS" is that good... Seriously, people have spent a lot of time getting pooling "right"... and it isn't any more code: using(SqlConnection conn = new SqlConnection(someString)) { conn.Open(); } that's it! I'm sure VB.NET has a "using" equivalent... (I'm a C# guy so can't say 100%) Marc |
#6
| |||
| |||
|
|
I have a "utility" connection in the code that is used for performing "plumbing" type tasks - building controls, logging error messages, reading system parameters from a parameter table, logging in a user, etc... That is the connection I would be caching. However, your comment tells me that I might be overloading the connection when there are many sessions so that is the sort of thing I was wondering about. Thanks. "Marc Gravell" wrote: in asp.net? that means that every request is going to be trying to use *the same* connection. Not even "MARS" is that good... Seriously, people have spent a lot of time getting pooling "right"... and it isn't any more code: using(SqlConnection conn = new SqlConnection(someString)) { conn.Open(); } that's it! I'm sure VB.NET has a "using" equivalent... (I'm a C# guy so can't say 100%) Marc |
#7
| |||
| |||
|
#8
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |