473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Preserving server resources

Hi All

Our server recently has started to play up and hangs every 7-10 days.
Someone has suggested that the way we open database connections might be
using too many server resources.

Can someone please point out what would be the bext way of opening a
database connection.

What we presently have is a connection.asp file which has the following
code.

CONNECTION.ASP

set conn = Server.Createobject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open "d:\mydatabases\Assets\Tracking.mdb"

We simply include this file on top of everypage that will need the database
connection however recently someone pointed out that we might be opening
connection unneccsarrily as the connection is being opened on every visit to
everypage but is not being closed.

Is this the correct approach?

Regards
Jas
Jul 19 '05 #1
1 1091
The biggest issue is making sure connections get closed and disposed. Open
as late as possible and close as soon as you are finished. That is one of
the surest ways to improve perf with conns.

After close, issue this:

Set conn = Nothing

The connection object will still be pooled by ADO, but it will not be
flagged as unable to destroy once it no longer needs the pool.

NOTE: In most cases, ASP takes care of this nicely. There are instances,
however, that you can end up with a memory leak by not closing and
destroying connections. Better safe than sorry.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"JP SIngh" <no**@none.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi All

Our server recently has started to play up and hangs every 7-10 days.
Someone has suggested that the way we open database connections might be
using too many server resources.

Can someone please point out what would be the bext way of opening a
database connection.

What we presently have is a connection.asp file which has the following
code.

CONNECTION.ASP

set conn = Server.Createobject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open "d:\mydatabases\Assets\Tracking.mdb"

We simply include this file on top of everypage that will need the database connection however recently someone pointed out that we might be opening
connection unneccsarrily as the connection is being opened on every visit to everypage but is not being closed.

Is this the correct approach?

Regards
Jas

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Cedric | last post by:
I have a WebPage with a usercontrol (webcomponent.dll). With the port 80 on the server, the webpage and the usercontrol works fine If i change the port (18802), the time of loading the usercontrol...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
2
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings...
5
by: Dave A | last post by:
I am writing an ASP.NET tool that will allow the client to create their own online froms. ie the client can add tect boxes, text, drop downs,etc with absolutely no technical skill what so ever....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
3
by: sophia.agnes | last post by:
Dear all, I was going through the book "C a software engineering approach by darnell & Margolis" there was a section named sign preserving vs value preserving it is as follows sign...
4
by: Phil Stanton | last post by:
Having spent ages sorting out the layout of my relationship window with about 60 tables and getting it all tidy and with enough of the tables visible to show the PK an FK relaionshipsOn a subseqent...
5
by: virtualweb | last post by:
Hello: I have two lists of emails saved in flat files one email per line. My script removes the emails in list 2 if they are present in list 1. Then reprints the email list, one email per line,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.