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

Expiring Database Connections

This question is only marginally related to Python, but I'm going to ask it
here because (a) this is the most tolerant group in the comp.lang
hierarchy, and (b) people in this group would know the answer.

Many of the Python-based web solutions use a long-running process: WebWare,
FastCGI, and mod_python all run an interpreter long-term, and keep the
classes loaded until the web server stops.

On Windows, with some databases, this represents a problem. With Access
specifically, and with SQLite occasionally, having an open database
connection can make it impossible to open the database from another
process, such as from a command line. It seems to me that I could solve
this problem by starting up a deadman timer when a database connection is
opened, and if no additional connections are made in, say, one or two
minutes, close the database connection completely.

I'm wondering if anyone has done such a thing and/or has any thoughts or
comments. My web searches were unsuccessful.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #1
1 1048
drs
"Tim Roberts" <ti**@probo.com> wrote in message
news:kk********************************@4ax.com...
Many of the Python-based web solutions use a long-running process: WebWare, FastCGI, and mod_python all run an interpreter long-term, and keep the
classes loaded until the web server stops.

On Windows, with some databases, this represents a problem. With Access
specifically, and with SQLite occasionally, having an open database
connection can make it impossible to open the database from another
process, such as from a command line. It seems to me that I could solve
this problem by starting up a deadman timer when a database connection is
opened, and if no additional connections are made in, say, one or two
minutes, close the database connection completely.

I'm wondering if anyone has done such a thing and/or has any thoughts or
comments. My web searches were unsuccessful.


Perhaps you could create a middle tier between the web and db to hold and or
pool the db connections. This way, you don't need to worry about which web
processes continue to run, you can share the connection object among them so
you don't have to close it at all, and you'll have a bit more control.

-drs
Jul 18 '05 #2

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

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
4
by: dustin lee | last post by:
Over the years I've gotten out of the habit of explicitly closing file objects (whether for reading or writing) since the right thing always seems to happen auto-magically (e.g. files get written...
3
by: bennett | last post by:
In the web.config file for my application, in the <sessionState> section I have set timeout="120" (in minutes), but session state variables in my application seem to be expiring in about 5 minutes....
6
by: Adam | last post by:
On an xp machine, the caching works as expected. I have deployed to a win2k server, and an item I add to the cache expires almost immediately some times and in under a minute in other times. The...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
35
by: Terry Jolly | last post by:
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...
4
by: Sierra | last post by:
Problem: Database connections are not being reused properly. SP_WHO2 shows upwards of 200 connections being created per page request. Most connections exist for 60 seconds then close without...
5
by: John | last post by:
I have an ASP.NET 2.0 application developed in VB.net, that accesses an Microsoft Access database. When the database is on the same IIS server all works just fine. BUT when it tried to access the...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.