Re: What is the fate of closed database connections?

2017-01-19 Thread Michael Grundler
It looks like the source of this error is related to a spatialite internal connection leak (discussed in this post: https://groups.google.com/forum/#!topic/spatialite-users/xrV7CA_GlwM) Each time Django requests a connection to the database sqlite loads the spatialite extension module, which cr

Re: What is the fate of closed database connections?

2017-01-18 Thread 'Tom Evans' via Django users
On Tue, Jan 17, 2017 at 7:58 PM, Fred Stluka wrote: > Mike, > > As of version 1.6, Django supports persistent DB connections > (connection pooling). Pedantry: Persistent connections are not the same as connection pooling. With persistent connections, if a worker does not have a currently open con

Re: What is the fate of closed database connections?

2017-01-17 Thread Fred Stluka
Mike, Good info.  Yeah, keep experimenting and report what you find here.  Hopefully someone will jump in with a definitive answer for you. --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristl

Re: What is the fate of closed database connections?

2017-01-17 Thread Michael Grundler
CONN_MAX_AGE = 1 behaves similarly to 2 and None. I will try and do some testing with additional spatialite DB drivers. Perhaps its worth noting that I have not seen any of these problems when using postgresql as the DB backend. Many thanks, Mike On Tuesday, January 17, 2017 at 4:18:01 PM UTC-

Re: What is the fate of closed database connections?

2017-01-17 Thread Fred Stluka
Mike, I agree.  It seems that 0 and 2 should have similar effects in your case.  Have you tried 1? So, 2 behaves like None, eh?  Perhaps that's because they are both allowing connections to be reused.  0 explicitly prevents connection pooling, so that e

Re: What is the fate of closed database connections?

2017-01-17 Thread Michael Grundler
Fred, I observe this behavior using uwsgi + nginx. Per your suggesting I tried a CONN_MAX_AGE = 2, which seems to have the same qualitative behavior as CONN_MAX_AGE = None (i.e. the error message does not appear in the log after repeatedly refreshing the browser on the admin page). I don't un

Re: What is the fate of closed database connections?

2017-01-17 Thread Fred Stluka
Mike, As of version 1.6, Django supports persistent DB connections (connection pooling).  CONN_MAX_AGE specifies the number of seconds that a connection will remain open and be reused. You can set it to 0 to cause each DB interaction to open, use, and close its o

What is the fate of closed database connections?

2017-01-17 Thread Michael Grundler
When Django closes a database connection at the end of a request/response cycle does that connection still maintain its hold on the database? I ask because I am running an app on a spatialite (v4.3.0a) database, which, due to a limitation in the GEOS library (v3.6.1-CAPI-1.10.1 r0), can onl

Re: Maximum database connections exceeded

2015-03-20 Thread Andreas Kuhne
fficiently. See https://wiki.postgresql.org/wiki/PgBouncer. That would probably solve the symptoms of your problem, but not the problem itself. Regards, Andréas 2015-03-20 16:52 GMT+01:00 Hans Kristian Flaatten : > My Django application is exceeding the maximum number of simultaneo

Maximum database connections exceeded

2015-03-20 Thread Hans Kristian Flaatten
My Django application is exceeding the maximum number of simultaneous database connections (100) to the Postgres database when running through Gunicorn with async eventlet workers. When the limit it exceeded it starts returning 500-errors until new connections can be established. Setting

Re: Django + Database Connections

2014-11-13 Thread Russell Keith-Magee
On Wed, Nov 12, 2014 at 11:42 AM, Edward Armes wrote: > HI guys, > > Thanks for your responses, they have indeed answered all my questions > pretty much as I was mainly looking for information on how to modify how > Django accesses it's ORM layer. However from your answer it seems that it > would

Re: Django + Database Connections

2014-11-12 Thread Edward Armes
Hi Russell, Thank you for your response it has mainly answered my questions as well as given me areas to think about where to insert the asynchronous layer. Edward On Tuesday, 11 November 2014 21:25:44 UTC, Russell Keith-Magee wrote: > > Hi Edward, > > On Tue, Nov 11, 2014 at 12:30 AM, Edward

Re: Django + Database Connections

2014-11-12 Thread Edward Armes
HI guys, Thanks for your responses, they have indeed answered all my questions pretty much as I was mainly looking for information on how to modify how Django accesses it's ORM layer. However from your answer it seems that it would be better that I do it at the model layer. I apologize for being s

Re: Django + Database Connections

2014-11-11 Thread Kakar Nyori
Very nicely explained. On Wed, Nov 12, 2014 at 2:55 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > Hi Edward, > > On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes > wrote: > >> Hi there, >> >> I am currently looking at Django for a personal project. While I >> understand how a lot of

Re: Django + Database Connections

2014-11-11 Thread Russell Keith-Magee
Hi Edward, On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes wrote: > Hi there, > > I am currently looking at Django for a personal project. While I > understand how a lot of it works I can't wrap my head around how the actual > DB querying is done specifically what part of Django actually looks at

Django + Database Connections

2014-11-10 Thread Edward Armes
Hi there, I am currently looking at Django for a personal project. While I understand how a lot of it works I can't wrap my head around how the actual DB querying is done specifically what part of Django actually looks at the database (I'm not talking about Manager, Models or Querysets, but the

Re: Opening up multiple database connections per request?

2014-02-04 Thread jeff do
wever, this is undocumented API, so you're on your > own if you take this path. > > Yours, > Russ Magee %-) > > > On Wed, Jan 22, 2014 at 7:40 AM, jeff do >wrote: > >> Is it possible to open up multiple database connections inside of one >> request in D

Re: Opening up multiple database connections per request?

2014-01-21 Thread Russell Keith-Magee
is undocumented API, so you're on your own if you take this path. Yours, Russ Magee %-) On Wed, Jan 22, 2014 at 7:40 AM, jeff do wrote: > Is it possible to open up multiple database connections inside of one > request in Django? I am using Django 1.6 and Python3.3. > > In

Opening up multiple database connections per request?

2014-01-21 Thread jeff do
Is it possible to open up multiple database connections inside of one request in Django? I am using Django 1.6 and Python3.3. In my use case, I have a web application that executes raw SQL against a data warehouse we have. For example, one page may require five different SQL queries to be

Re: Question on Multiple Database Connections

2012-12-14 Thread Matt Woodward
On Thursday, December 13, 2012 8:01:13 AM UTC-8, ke1g wrote: > > > Just a shot in the dark: Maybe if, since you're not using the ORM on the > 'other' database, you shouldn't use django-pyodbc, but rather just pyobdc. > I should have said this earlier but I had the same thought and tried doing it

Re: Question on Multiple Database Connections

2012-12-13 Thread Bill Freeman
On Wed, Dec 12, 2012 at 7:49 PM, Matthew Woodward wrote: > I'm working on an application that uses two databases -- one is the main > database that Django ORM talks to, where sessions are stored, etc. and the > other is an external database where we need to run some storedprocs to > retrieve some

Question on Multiple Database Connections

2012-12-12 Thread Matthew Woodward
I'm working on an application that uses two databases -- one is the main database that Django ORM talks to, where sessions are stored, etc. and the other is an external database where we need to run some storedprocs to retrieve some data. This is all working fine for the most part but I ran into a

Manual selection of database connections

2009-05-21 Thread junqed
I have some DB servers with similar structure but with different data. I want to select a connection manually. How can I do it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Django database connections

2009-02-14 Thread Alex Gaynor
On Sat, Feb 14, 2009 at 4:15 PM, Jack Orenstein wrote: > > I'm trying to understand how Django 1.0 handles connections. This is > from the django docs, on the subject of raw SQL: > > from django.db import connection > cursor = connection.cursor() > cursor.execute("select ...") > r

Django database connections

2009-02-14 Thread Jack Orenstein
I'm trying to understand how Django 1.0 handles connections. This is from the django docs, on the subject of raw SQL: from django.db import connection cursor = connection.cursor() cursor.execute("select ...") row = cursor.fetchone() If I have a Django app running lots of re

Re: database connections

2007-06-23 Thread Gary Doades
Mike H wrote: > Hi all, > > Is there a recommended solution for connection pooling with postgres? > I've seen SqlRelay and pgpool mentioned but they both seem to have > downsides in terms of affecting query performance. What have people here > used? > I use pgpool and it works brilliantly.

Re: database connections

2007-06-23 Thread Malcolm Tredinnick
On Sat, 2007-06-23 at 13:30 +0100, Mike H wrote: > Hi all, > > It looks like we're going to start work on a very high profile site and > I'm investigating performance tweaks we can make to ensure we can handle > the load :) > > One of the areas I'm concerned about is having to make a connectio

database connections

2007-06-23 Thread Mike H
Hi all, It looks like we're going to start work on a very high profile site and I'm investigating performance tweaks we can make to ensure we can handle the load :) One of the areas I'm concerned about is having to make a connection to the database for every request, and I'd be very grateful

Re: database connections

2007-06-14 Thread [EMAIL PROTECTED]
s of everything being a first-class object in Python > is so that things can be replaced at runtime. The only question is > whether you can get in early enough in the pipeline to replace the > functionality before it is used. I'm not sure in this case, although it > might be tricky to

Re: database connections

2007-06-14 Thread Malcolm Tredinnick
its of everything being a first-class object in Python is so that things can be replaced at runtime. The only question is whether you can get in early enough in the pipeline to replace the functionality before it is used. I'm not sure in this case, although it might be tricky to do so. Database

database connections

2007-06-13 Thread [EMAIL PROTECTED]
Greetings. I am about 75% through creating a django application as a new section of my company's site, www.etsy.com. It's basically a CMS, something that I know django is especially well suited to (tho I can tell it would work for nearly any domain). Recently, my site ops team started asking me q

DBISAM (or other ODBC, or native) DataBase connections...

2007-04-12 Thread durumdara
database connections in a django project? Please help me in the question. Thanks for it. dd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [EMAIL PRO

Re: Limiting database connections?

2005-08-15 Thread [EMAIL PROTECTED]
SQLRelay seems like an acceptable option. If this is the recommended way to do things, is any work being done on making it work?

Re: Limiting database connections?

2005-08-12 Thread Jeremy Dunck
On 8/12/05, Maniac <[EMAIL PROTECTED]> wrote: > To be honest, may be those problems were related to PHP or Oracle's part > of SQLRelay, and won't affect other environments, and it was like a year > ago, so may be it was fixed since... But now for me it doesn't look very > promising. It's clearly b

Re: Limiting database connections?

2005-08-12 Thread Maniac
Jacob Kaplan-Moss wrote: I just today ran across sqlrelay (http://sqlrelay.sourceforge.net/) which looks *extremely* promising for this type of use. Does anyone have any experience with it, and is there any interest in me writing a sqlrelay backend? We did :-). We tried to squeze it bet

Re: Limiting database connections?

2005-08-12 Thread Jacob Kaplan-Moss
On Aug 12, 2005, at 4:36 PM, Matthew Marshall wrote: From this quote on the sqlrelay site... """ An application coded using another database's native client API may be able to use SQL Relay without modification. SQL Relay provides drop-in replacement libraries for: * MySQL * PostgreSQL

Re: Limiting database connections?

2005-08-12 Thread Matthew Marshall
On Friday 12 August 2005 08:14 pm, Jacob Kaplan-Moss wrote: > I just today ran across sqlrelay (http://sqlrelay.sourceforge.net/) > which looks *extremely* promising for this type of use. Does anyone > have any experience with it, and is there any interest in me writing > a sqlrelay backend? > >

Re: Limiting database connections?

2005-08-12 Thread Jacob Kaplan-Moss
On Aug 12, 2005, at 3:10 PM, Ksenia Marasanova wrote: 2005/8/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: I ran out of database connections today. I'd like to prevent this in a way other than increasing my database connections. How does this work in Django? I'd like mo

Re: Limiting database connections?

2005-08-12 Thread Ksenia Marasanova
2005/8/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > I ran out of database connections today. I'd like to prevent this in a > way other than increasing my database connections. > > How does this work in Django? I'd like more reuse and all. Coming > from a

Re: Limiting database connections?

2005-08-12 Thread Jason McBrayer
[EMAIL PROTECTED] wrote: I ran out of database connections today. I'd like to prevent this in a way other than increasing my database connections. Jonpy (jonpy.sf.net) has a nice and simple dbpool module. I'm not sure how much work it would take to get django to use it, however.

Limiting database connections?

2005-08-12 Thread [EMAIL PROTECTED]
I ran out of database connections today. I'd like to prevent this in a way other than increasing my database connections. How does this work in Django? I'd like more reuse and all. Coming from a java background, it's typical for me to configure my application to use very