473,387 Members | 1,790 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,387 software developers and data experts.

Connection Handling

Hi,

1) Open one connection to the database and reuse the connection all
the time until i exit the system.
2) Open connection to the database, close the connection when the query
finish, reopen again the connection for another query and close it when
finish.
May i know which one is better for performance and which one is suggested to
be used and what is the pro and cons?

Thanks

regards,

florencelee
Jul 21 '05 #1
1 1110
Flrencelee,

This is a simple answer, 2 and use dispose instead for close in this case,
the connection is that one of the exceptions for that.

(With exceptions to an MSAccess database when that should be locked to his
place on disk)

Reason is the connection pooling when there can be more than 100
simultanious connections.

I hope this helps?

Cor

"Florencelee" <Fl*********@discussions.microsoft.com>
Hi,

1) Open one connection to the database and reuse the connection all the time until i exit the system.
2) Open connection to the database, close the connection when the query
finish, reopen again the connection for another query and close it when
finish.
May i know which one is better for performance and which one is suggested to be used and what is the pro and cons?

Thanks

regards,

florencelee

Jul 21 '05 #2

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

Similar topics

3
by: Ryan N. | last post by:
Hello, I saw a brief blurb on this somewhere and am unable to recall where... In the context of Security, what are some best practices for handling -storing, locating, retrieving- database OLEDB...
9
by: Dr. Know | last post by:
Greetings, I am running IIS on W2kServer and am trying to use ASP with some legacy X-Base tables. I cannot get the provider to connect. Relevant code is: strProvider =...
1
by: June Moore | last post by:
Hi, I am getting an error with the following code. Error is: ADODB.Connection error '800a0e78' - The operation requested by the application is not allowed if the object is closed. Any ideas how...
4
by: Edward Singleton | last post by:
I am currently developing a web app using WSAD 5.1 and DB2 V7.2.8. I understand there is a myriad of database errors related to obtaining valid connections that are mapped directly to...
7
by: greg | last post by:
Hi We have w2k, iis5, .NET/c# I periodically receive this message and the system freezes ++++++++++++++++++++++++++++++++++++++++++++++++++ Timeout expired. The timeout period elapsed...
3
by: OL | last post by:
Hello All, I need help understanding DB connection mgmt. Scenario: - 3 separate Web application - IIS 5 or 6 - dynamic pages for most part - DB Backend is Adaptive server Anywhere from...
2
by: Michel Esber | last post by:
Hello, DB2 V7 FP14 running Linux. Our application constantly tests whether the database connection is still alive before sending new statements to the DB. A "values current timestamp"...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
0
by: Greg Copeland | last post by:
According to the SQLAlchemy list, the DBAPI specification does not define a standard error reporting mechanism which would allow for generic detection of loss of database connection without DB...
0
by: Rashmi R | last post by:
Hi All, Our service is a custom builtin server using ACE framework in VC++. The connection handling is by ODBC. But now we need to change the connection handling to OLEDB. I tried to change the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.