PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Best practices for using Connections in connected environment?
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Best practices for using Connections in connected environment?
![]() |
Best practices for using Connections in connected environment? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi all,
I'd be interested in hearing opinions for best practices regarding handling data connection in a connected (desktop client/server) application environment. I'm working with the assumption that the database (driver/component/etc.) supports pooling. I'm currently working on an MDI app that in which the user will potentially be looking at/editing data from many different datasets for the better part of the day. In the past, I've only worked in disconnected/web environments, so the idea has been to drop the connection as quickly as possible to return it to the pool. My guess here is to use a single connection per application instance, and for each class that needs a connection let them share with one another. Thanks, Michael |
|
|
|
#2 |
|
Guest
Posts: n/a
|
I would continue to code as you did before (create-connect, use,
close-destroy). When your code creates a new connection it will be getting one immediately from the system that was already open. The actual database connection between the machine and the server will be pooled(kept open) by the system for the duration of the inactivity timeout. If your application needs more than one open at a time it will be created but in a client-server application you will seldom require more than one. -- Brad "Software is like melted pudding..." "Michael Russell" wrote: > Hi all, > > I'd be interested in hearing opinions for best practices regarding > handling data connection in a connected (desktop client/server) > application environment. I'm working with the assumption that the > database (driver/component/etc.) supports pooling. I'm currently > working on an MDI app that in which the user will potentially be looking > at/editing data from many different datasets for the better part of the day. > > In the past, I've only worked in disconnected/web environments, so the > idea has been to drop the connection as quickly as possible to return it > to the pool. > > My guess here is to use a single connection per application instance, > and for each class that needs a connection let them share with one > another. > > Thanks, > Michael > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
See my blog (http://betav.com/blog/billva) for a response.
hth -- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Michael Russell" <mr_b15h0p@hotmail.com> wrote in message news:OFZWcHXkGHA.1508@TK2MSFTNGP04.phx.gbl... > Hi all, > > I'd be interested in hearing opinions for best practices regarding > handling data connection in a connected (desktop client/server) > application environment. I'm working with the assumption that the > database (driver/component/etc.) supports pooling. I'm currently working > on an MDI app that in which the user will potentially be looking > at/editing data from many different datasets for the better part of the > day. > > In the past, I've only worked in disconnected/web environments, so the > idea has been to drop the connection as quickly as possible to return it > to the pool. > > My guess here is to use a single connection per application instance, and > for each class that needs a connection let them share with one another. > > Thanks, > Michael |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Terence,
The same as Michael, do it in the same way as you was used in an ASPNET applicication. (You know that for a dataadapter or a tableadapter don't even have to open and close the connection? That is done in the adapter). Cor "Michael Russell" <mr_b15h0p@hotmail.com> schreef in bericht news:OFZWcHXkGHA.1508@TK2MSFTNGP04.phx.gbl... > Hi all, > > I'd be interested in hearing opinions for best practices regarding > handling data connection in a connected (desktop client/server) > application environment. I'm working with the assumption that the > database (driver/component/etc.) supports pooling. I'm currently working > on an MDI app that in which the user will potentially be looking > at/editing data from many different datasets for the better part of the > day. > > In the past, I've only worked in disconnected/web environments, so the > idea has been to drop the connection as quickly as possible to return it > to the pool. > > My guess here is to use a single connection per application instance, and > for each class that needs a connection let them share with one another. > > Thanks, > Michael |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

