468,250 Members | 1,600 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,250 developers. It's quick & easy.

Pylons, SQLAlchemy, too many connections problem.

Hello.

I have pylons 0.96 (SVN) and current SQLAlchemy (0.3.10), and I have bug
that
doesn't exist earlier.

My connection code:
<code>
import sqlalchemy.mods.threadlocal
from sqlalchemy import DynamicMetaData, objectstore

metadata = DynamicMetaData( case_sensitive = False )

def db_connect( dsn ):
engine = create_engine( dsn, echo=False, echo_pool=False,
encoding='latin2', convert_unicode=True )
metadata.connect( engine )
</code>

command "netstat -an|grep 5432|grep ESTABLISHED|wc -l" displays one
more connection after each refresh of page until I have exceptions
such as:

sqlalchemy.exceptions.DBAPIError: (Connection failed)
(OperationalError) FATAL: sorry, too many clients already

What is wrong?

Aug 31 '07 #1
2 3678
Adam Kubica a crit :
Hello.

I have pylons 0.96 (SVN) and current SQLAlchemy (0.3.10), and I have bug
that
doesn't exist earlier.

My connection code:
<code>
import sqlalchemy.mods.threadlocal
from sqlalchemy import DynamicMetaData, objectstore

metadata = DynamicMetaData( case_sensitive = False )

def db_connect( dsn ):
engine = create_engine( dsn, echo=False, echo_pool=False,
encoding='latin2', convert_unicode=True )
metadata.connect( engine )
</code>

command "netstat -an|grep 5432|grep ESTABLISHED|wc -l" displays one
more connection after each refresh of page until I have exceptions
such as:

sqlalchemy.exceptions.DBAPIError: (Connection failed)
(OperationalError) FATAL: sorry, too many clients already

What is wrong?
I don't know for sure, but I guess you'd get better answers posting
either on the Pylons or SQLAlchemy's google groups.
Aug 31 '07 #2
On Fri, 31 Aug 2007 14:03:48 +0200, Adam Kubica wrote:
Hello.

I have pylons 0.96 (SVN) and current SQLAlchemy (0.3.10), and I have bug
that
doesn't exist earlier.

My connection code:
<code>
import sqlalchemy.mods.threadlocal
from sqlalchemy import DynamicMetaData, objectstore

metadata = DynamicMetaData( case_sensitive = False )

def db_connect( dsn ):
engine = create_engine( dsn, echo=False, echo_pool=False,
encoding='latin2', convert_unicode=True )
metadata.connect( engine )
</code>

command "netstat -an|grep 5432|grep ESTABLISHED|wc -l" displays one
more connection after each refresh of page until I have exceptions
such as:

sqlalchemy.exceptions.DBAPIError: (Connection failed)
(OperationalError) FATAL: sorry, too many clients already

What is wrong?
Don't use DynamicMetaData(), use MetaData(), it's the problem.
Aug 31 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by John Salerno | last post: by
reply views Thread by Karlo Lozovina | last post: by
6 posts views Thread by Ilias Lazaridis | last post: by
3 posts views Thread by Greg Copeland | last post: by
reply views Thread by Nathan Harmston | last post: by
4 posts views Thread by Mage | last post: by
1 post views Thread by John Salerno | last post: by
5 posts views Thread by John Salerno | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.