Re: Making a database connection global
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Sun, 14 May 2006 15:13:15 +0200
Using only one single database connection for a web application? Good one...
You could just as well neuter the web server by only allowing one single thread, as the other threads only will be waiting for the connection to get free.
What database are you using? If you are only going to use a single connection against it you should consider downgrading to something low-grade like MSDE or Access. Or why not anything even simpler like storing the data in text files?
Terry Jolly wrote:
Web Solution.
Goal: Have a global database connection
Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once.
I put the connection string in the web.config.
I created a class with a static database connection and the class opens and closes the database.
This seems to work so the question: Is there a better way to handle the database connection?
Thanks In Advance.
- Follow-Ups:
- Re: Making a database connection global
- From: Ray Booysen
- Re: Making a database connection global
- References:
- Making a database connection global
- From: Terry Jolly
- Making a database connection global
- Prev by Date: Re: Making a database connection global
- Next by Date: Re: Making a database connection global
- Previous by thread: Re: Making a database connection global
- Next by thread: Re: Making a database connection global
- Index(es):
Relevant Pages
|