Pylons, SQLAlchemy, too many connections problem.

A

Adam Kubica

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?
 
B

Bruno Desthuilliers

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.
 
A

Adam Kubica

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top