PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Best practices for using Connections in connected environment?

Reply

Best practices for using Connections in connected environment?

 
Thread Tools Rate Thread
Old 16-06-2006, 07:22 PM   #1
Michael Russell
Guest
 
Posts: n/a
Default Best practices for using Connections in connected environment?


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
  Reply With Quote
Old 16-06-2006, 09:21 PM   #2
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
 
Posts: n/a
Default RE: Best practices for using Connections in connected environment?

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
>

  Reply With Quote
Old 16-06-2006, 09:46 PM   #3
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: Best practices for using Connections in connected environment?

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



  Reply With Quote
Old 17-06-2006, 07:17 AM   #4
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Best practices for using Connections in connected environment?

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



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off