Re: ADO Connections - close them or keep them open?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jaxon (GregoryAJackson_at_hotmail.com)
Date: 06/15/04


Date: Tue, 15 Jun 2004 10:52:24 -0700

see inline:

> Every white paper I read is about WEB Access and ASP pages.
There are many white papers on Data Access Strategies and best practices for
N-Tier Applications. It is essentially the same for Web Apps. Web apps can
be (and likely should be) designed as n-tier apps.

>
> This is not what we have here. We have a school district - on an internal
network - many buildings - 1000+ teachers. Teachers get into attendance app
for less than 30 minutes and post attendance for classes. Admin folks and
secretaries get in for the whole day - call up kids, start maintenance - get
phone calls - interruptions.

That's fine. This still works for N-Tier Architecture

>
> What do you mean "share the connection". I meant "global connection" in
VB - global to all the forms that the user might call up in the app - I
didn't mean global to all users.

if Each user keeps a Global Connection object in their App on the client
side, you likely will run out of connections quickly and requests will start
to queue up. This is not scalable as larger number of clients adds up.

Connections are a precious resource that should be obtained late and
released early so that connections dont become your system bottleneck.

>
> Each workstation runs the app and makes a connection - no sharing
involved. We do all our server side work with SPROCS - so ADO calls the
SPROC from VB - returns the recordset and then the connection stays open
until the next ADO/SPROC call.

This sounds like a class 2-tier or Client Server app to me then. likely too
late to turn it into an N-Tier App....you may be stuck. However, I would
still not keep global connections around.

>
> We use win-nt authentication - so taking advantage of SQL pooling of
connections so a similiar one can be found doesn't really make sense to us.

if each user logs in directly to sql server, you are rigth. You might want
to rethink this and have your code access the DB using a handful of standard
logins (ReadOnly, Read Write, REad Write Delete, Admin, Etc). Then you can
take advantage of pooling and you can scale better

>
> I've found info that says that establishing the connection can be time
consuming - so why relinquish it and re-establish it??

You're right. You dont want to do this. You want to try to pool connections.

>
> Other programmers at this school district use ACCESS to touch there DB's.
I see that ACCESS opens "several" connections for just one user at a time -
this seems more of a waste of resources.

Yes Access connectivity to a SQL Server DB can be downright crippling.

hope all this info helps. Sounds like you are already married to an
architecture that you wont be able to change. You may be stuck into doing
what you are currently doing....

Cheers

GAJ



Relevant Pages

  • Re: Winforms v webforms?
    ... Windows app Offline/Online mode - you would have to do additional ... SQL Server connections - i am not too sure, ... windows client with web services on a server to fix this problem). ...
    (microsoft.public.dotnet.general)
  • Re: Win XP slow, Win 98 fast
    ... different connections. ... uses SQL Server 7.0 SP4 as the underlying database engine which is running on ... third party app. ...
    (microsoft.public.sqlserver.connect)
  • DTS connection to Pervasive DB thru VB6
    ... I have a custom vb app that uses a DTS package to take data from a Prevasive ... table and import to SQL Server. ... DSN-Less connection to the Pervasive DB or FileDSN connections with the file ...
    (microsoft.public.data.oledb)
  • Re: .net IDE Shuts Down during a build
    ... I did not get to try your solution coz .. ... Shut down the IDE ... Then envoke the web app from the browser, then open the IDE, then ... > which you can re-enable the network connections and the IDE seems to be OK ...
    (microsoft.public.vsnet.ide)
  • Re: Tomcat cant connect to MySQL
    ... rarely, the app is able to recover, and if all connections have leaked, ... MySQL is still running because other apps can hit the same ... Tomcat & Apache are both still running ...
    (comp.lang.java.programmer)