[sqlalchemy] Too many database connections.

2007-08-29 Thread caffecoder
Hello. I have pylons 0.96 (SVN) and current SQLAlchemy (0.3), 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 ):

[sqlalchemy] SA 0.4 orm mapped class 'instrumentation time'

2007-08-29 Thread Marco De Felice
With SA 0.4beta4 if I try to access a mapped object field (Table.c.fieldname) before any query has been sent to the database the call fails with a AttributeError(key). Everything works if I do this after having issued a query. -- Example: (skip to the __main__ section) import sqlalchemy as sqa

[sqlalchemy] [ANN] FormAlchemy 0.1 released !

2007-08-29 Thread Alexandre Conrad
Dear SQLAlchemy users, I am pleased to announce the first release of FormAlchemy ! FormAlchemy: Auto-generated, customizable HTML input form fields from your SQLAlchemy mapped classes. FormAlchemy is a library written in Python that generates HTML form fields from your SQLAlchemy's mapped

[sqlalchemy] Re: Too many database connections.

2007-08-29 Thread Mike Orr
On 8/28/07, caffecoder [EMAIL PROTECTED] wrote: sqlalchemy.exceptions.DBAPIError: (Connection failed) (OperationalError) FATAL: sorry, too many clients already I've been getting a similar but not identical error after upgrading to SQLAlchemy 0.4, and somebody else on the list also mentioned

[sqlalchemy] sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread Jian Luo
Hi List: I am just doing a test of my pylons site under medium load. (ab2 -c 20 -n 5000 ...) and got following errors: 2007-08-29 17:32:34,468 INFO [paste.httpserver.ThreadPool] kill_hung_threads status: 10 threads (10 working, 0 idle, 0 starting) ave time 2.24sec, max time 7.22sec, killed 0

[sqlalchemy] Updating the sequence number

2007-08-29 Thread alex.schenkman
Hi: I'm new to SQL. I have to execute the following SQL line, which updates a sequence number. The table zseq_document_types_lookup has only one record with this number. update zseq_document_types_lookup set id=2; I thought of retrieving the record with something like this: class

[sqlalchemy] Read only connection with Table reflection

2007-08-29 Thread Jason Koelker
I am attempting to use SQLAlchemy's table reflection to access a MSSQL 2k database. However the user I can connect with only had db_datareader access. When SQLAlchemy tries to load the schema, it attempts a rollback at the end, which the user does not have permission to execute: 2007-08-29

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread jason kirtland
Jian wrote: Hi List: I am just doing a test of my pylons site under medium load. (ab2 -c 20 -n 5000 ...) and got following errors: 2007-08-29 17:32:34,468 INFO [paste.httpserver.ThreadPool] kill_hung_threads status: 10 threads (10 working, 0 idle, 0 starting) ave time 2.24sec, max

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread Jian Luo
Hi Jason, thanks for the reply. My pylons basecontroller takes care of the session clean up like this: class BaseController(WSGIController): def __call__(self, environ, start_response): try: return WSGIController.__call__(self, environ, start_response) finally:

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread jason kirtland
Jian wrote: Hi Jason, thanks for the reply. My pylons basecontroller takes care of the session clean up like this: class BaseController(WSGIController): def __call__(self, environ, start_response): try: return WSGIController.__call__(self, environ,

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread Jian Luo
the remove is described in doc as close + extra cleanup Shouldn't the doc be updated to add that point, which will make the the life of newbies like me easier =D Or better: add the explicitly close in remove. Best Jian On Aug 30, 12:10 am, jason kirtland [EMAIL PROTECTED] wrote: Jian wrote:

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread jason kirtland
Jian wrote: the remove is described in doc as close + extra cleanup Shouldn't the doc be updated to add that point, which will make the the life of newbies like me easier =D Or better: add the explicitly close in remove. Yeah, the current remove() implementation in trunk isn't yet in sync

[sqlalchemy] Re: Read only connection with Table reflection

2007-08-29 Thread shday
Is there any way to use reflection with a read only connection? I use reflection on an Oracle database with read only permission, no problems (using SA 0.3.8). I don't recall seeing SA trying to do a ROLLBACK during reflection though. Steve

[sqlalchemy] Re: SA 0.4 orm mapped class 'instrumentation time'

2007-08-29 Thread Michael Bayer
its most likely uncompiled mappers. the c attribute on the class is deprecated; use Table.attribute instead. Also issue compile_mappers() after your mappers have been established to force a compile. The typical usage pattern is that the session.query() is created first, which also

[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2

2007-08-29 Thread Michael Bayer
Ive committed this fix in r3425. remove() calls close() on an existing session if one is present. On Aug 29, 2007, at 6:49 PM, jason kirtland wrote: Jian wrote: the remove is described in doc as close + extra cleanup Shouldn't the doc be updated to add that point, which will make the

[sqlalchemy] Re: Read only connection with Table reflection

2007-08-29 Thread Michael Bayer
On Aug 29, 2007, at 1:55 PM, Jason Koelker wrote: I am attempting to use SQLAlchemy's table reflection to access a MSSQL 2k database. However the user I can connect with only had db_datareader access. When SQLAlchemy tries to load the schema, it attempts a rollback at the end, which the

[sqlalchemy] Re: Read only connection with Table reflection

2007-08-29 Thread Jason Koelker
On Aug 29, 7:27 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Aug 29, 2007, at 1:55 PM, Jason Koelker wrote: I am attempting to use SQLAlchemy's table reflection to access a MSSQL 2k database. However the user I can connect with only had db_datareader access. When SQLAlchemy tries to