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

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

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/

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

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

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

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

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