Thread: [SQLObject] Leaking connections
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Florian S. <flo...@gm...> - 2004-07-19 11:07:54
|
Hi! Is anyone using SQLObject with long running processes which open many (short lived) connections? Currently there seems to be no way to really close connections. Sooner or later I get errors about to many connections to the database and many many idle database processes. I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). Regards, Florian Schulze |
From: Ahmed M. A. <ahm...@wa...> - 2004-07-19 11:54:46
|
Hi Florian , I'am using MaxDB database and i have encountered some problems with the connection. Sometimes,my connection object become invalid.I fixed with the next patch;I don't know if this will solve your problem. Anyway,let me know if it solves. file : sqlobject/dbconnection.py method: DBAPI.releaseConnection [-] if self._pool is None: [+] if not self._pool: [-] if self._pool is not None: [+] if self._pool : Ahmed MOHAMED ALI "Florian Schulze" <flo...@gm...> wrote in message news:ops...@nw...... > Hi! > > Is anyone using SQLObject with long running processes which open many > (short lived) connections? Currently there seems to be no way to really > close connections. Sooner or later I get errors about to many connections > to the database and many many idle database processes. > > I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). > > Regards, > Florian Schulze > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click |
From: Michael W. <mw...@mi...> - 2004-07-19 14:27:26
|
Is there any reason why you are opening so many connections? In a typical long-running web app I have 2 - 4 connections open max (depending on how many processes SCGI - I use Quixote - has forked), even when the app runs for many days without restarting. I've not looked closely at the __connection__ magic variable to know how that behaves. For my purposes I created a singleton class pattern which has a get_connection() method and assigns the result of this to each SQLObject's _connection property. On Mon, 2004-07-19 at 04:11, Florian Schulze wrote: > Hi! > > Is anyone using SQLObject with long running processes which open many > (short lived) connections? Currently there seems to be no way to really > close connections. Sooner or later I get errors about to many connections > to the database and many many idle database processes. > > I'm using SQLObject from Subversion (Rev 163) with Postgresql (psycopg). > > Regards, > Florian Schulze > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss -- Mike Watkins mw...@mi... Here in my heart, I am Helen; I'm Aspasia and Hero, at least. I'm Judith, and Jael, and Madame de Sta"el; I'm Salome, moon of the East. Here in my soul I am Sappho; Lady Hamilton am I, as well. In me R'ecamier vies with Kitty O'Shea, With Dido, and Eve, and poor nell. I'm all of the glamorous ladies At whose beckoning history shook. But you are a man, and see only my pan, So I stay at home with a book. -- Dorothy Parker |
From: Sidnei da S. <si...@aw...> - 2004-07-19 14:36:37
|
On Mon, Jul 19, 2004 at 07:27:11AM -0700, Michael Watkins wrote: | For my purposes I created a singleton class pattern which has a | get_connection() method and assigns the result of this to each | SQLObject's _connection property. I have used a descriptor for _connection which fetches a connection from a global per-thread connection cache. -- Sidnei da Silva <si...@aw...> http://awkly.org - dreamcatching :: making your dreams come true http://www.enfoldsystems.com http://plone.org/about/team#dreamcatcher <Intention> How EXACTLY are cameras used to keep planes from hitting skyscrapers? Do they have laser attatchments? |
From: Florian S. <flo...@gm...> - 2004-07-20 06:11:23
|
On Mon, 19 Jul 2004 11:35:17 -0300, Sidnei da Silva <si...@aw...> wrote: > On Mon, Jul 19, 2004 at 07:27:11AM -0700, Michael Watkins wrote: > | For my purposes I created a singleton class pattern which has a > | get_connection() method and assigns the result of this to each > | SQLObject's _connection property. > > I have used a descriptor for _connection which fetches a connection > from a global per-thread connection cache. That would be an option. I use SQLObject from inside Zope (2.7) and I create a new connection on each request. How can I create a per-thread cache? I didn't work with thread-crossing code yet. Do you use a dictionary with the thread-id as the key? Regards, Florian Schulze |
From: Sidnei da S. <si...@aw...> - 2004-07-20 16:04:51
|
| That would be an option. I use SQLObject from inside Zope (2.7) and I | create a new connection on each request. How can I create a per-thread | cache? I didn't work with thread-crossing code yet. Do you use a | dictionary with the thread-id as the key? Yup. Exactly. -- Sidnei da Silva <si...@aw...> http://awkly.org - dreamcatching :: making your dreams come true http://www.enfoldsystems.com http://plone.org/about/team#dreamcatcher <radix> how many people are we going to get posting to the list "How do I do X? I can't use <perfect solution>, it doesn't fit my design" today? |