Re: [sqlalchemy] What is a good pattern for using sqlalchemy+psycopg2+gevent in a pylons app

2010-06-25 Thread Yang Zhang
On Fri, Jun 4, 2010 at 7:16 AM, afrotypa ovuaia...@gmail.com wrote: Hi All, For a while I have been toying with the idea of developing/running a database (postgresql backend) driven WSGI app using an async python WSGI server such as gevent. Now that the newer psycopg2 (=2.2.0) drivers

[sqlalchemy] Getting ORM to use locking selects (select for update, etc.)

2010-06-25 Thread Yang Zhang
How do I get the ORM to use locking selects when I do a Session.query()? E.g., select for update, or select for share (PG)/select lock in share mode (MySQL). I know this is possible using the lower-level SQL expression library. Thanks in advance. -- Yang Zhang http://yz.mit.edu/ -- You

[sqlalchemy] Exception during cleanup leaking DB connections?

2010-06-25 Thread jgarbers
I'm using SQLA in a CherryPy / WSGI--based application running behind Apache2. The database is hosted on Amazon RDS (MySQL). Recently I've noticed several errors like this in my logs: [error] Exception AttributeError: AttributeError('NoneType' object has no attribute 'pop',) in bound method

Re: [sqlalchemy] What is a good pattern for using sqlalchemy+psycopg2+gevent in a pylons app

2010-06-25 Thread Michael Bayer
On Jun 25, 2010, at 3:32 AM, Yang Zhang wrote: On Fri, Jun 4, 2010 at 7:16 AM, afrotypa ovuaia...@gmail.com wrote: Hi All, For a while I have been toying with the idea of developing/running a database (postgresql backend) driven WSGI app using an async python WSGI server such as gevent.

Re: [sqlalchemy] Getting ORM to use locking selects (select for update, etc.)

2010-06-25 Thread Michael Bayer
On Jun 25, 2010, at 3:27 AM, Yang Zhang wrote: How do I get the ORM to use locking selects when I do a Session.query()? E.g., select for update, or select for share (PG)/select lock in share mode (MySQL). I know this is possible using the lower-level SQL expression library. Thanks in

Re: [sqlalchemy] Exception during cleanup leaking DB connections?

2010-06-25 Thread Michael Bayer
On Jun 25, 2010, at 9:26 AM, jgarbers wrote: I'm using SQLA in a CherryPy / WSGI--based application running behind Apache2. The database is hosted on Amazon RDS (MySQL). Recently I've noticed several errors like this in my logs: [error] Exception AttributeError: AttributeError('NoneType'

[sqlalchemy] SQLAlchemy gives QPool limit error, connection times out

2010-06-25 Thread Krishnakant Mane
Hello all, I am using sqlalchemy in an xml rpc based application. It is an API for accounting software. The error given belo is encountered inconsistently on the application and I can't figure out why. raise exc.TimeoutError(QueuePool limit of size %d overflow %d reached, connection timed

Re: [sqlalchemy] What is a good pattern for using sqlalchemy+psycopg2+gevent in a pylons app

2010-06-25 Thread Yang Zhang
On Fri, Jun 25, 2010 at 6:41 AM, Michael Bayer mike...@zzzcomputing.com wrote: That's as deep as my thought goes on this and its all based on hypotheticals since I've never used twisted or greenlets or anything like that.    Sorry if I'm totally off on how gevent/greenlets work, the linked

[sqlalchemy] Connection initialization

2010-06-25 Thread Rhett Garber
When we make a new connection to the database (MySQL in this case), it appears that the dialect has some initialization functions than run several queries: connection duration rows query primary_slave/tid=92761174.014ms 1'SELECT DATABASE()'

Re: [sqlalchemy] Connection initialization

2010-06-25 Thread Michael Bayer
On Jun 25, 2010, at 6:53 PM, Rhett Garber wrote: When we make a new connection to the database (MySQL in this case), it appears that the dialect has some initialization functions than run several queries: connection duration rows query primary_slave/tid=9276117

Re: [sqlalchemy] Getting ORM to use locking selects (select for update, etc.)

2010-06-25 Thread Yang Zhang
On Fri, Jun 25, 2010 at 6:42 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 25, 2010, at 3:27 AM, Yang Zhang wrote: How do I get the ORM to use locking selects when I do a Session.query()?  E.g., select for update, or select for share (PG)/select lock in share mode (MySQL).  I know